fix(pdfengines): read metadata better webhook error - fixes #1148

This commit is contained in:
Julien Neuhart
2025-05-15 09:22:52 +02:00
parent 66317197b6
commit 9aaab97d6a
5 changed files with 48 additions and 24 deletions

View File

@@ -500,6 +500,11 @@ func readMetadataRoute(engine gotenberg.PdfEngine) api.Route {
err = c.JSON(http.StatusOK, res)
if err != nil {
if strings.Contains(err.Error(), "request method or response status code does not allow body") {
// High probability that the user is using the webhook
// feature. It does not make sense for this route.
return api.ErrNoOutputFile
}
return fmt.Errorf("return JSON response: %w", err)
}