feat(webhook): switch to --webhook-enable-sync-mode flag instead of header

This commit is contained in:
Julien Neuhart
2025-08-09 16:17:27 +02:00
parent fc11f557fa
commit 02ad6c7834
4 changed files with 9 additions and 15 deletions

View File

@@ -235,18 +235,7 @@ func webhookMiddleware(w *Webhook) api.Middleware {
}
}
webhookSyncHeader := c.Request().Header.Get("Gotenberg-Webhook-Sync")
webhookSync := false
if webhookSyncHeader != "" {
var err error
webhookSync, err = strconv.ParseBool(webhookSyncHeader)
if err != nil {
return fmt.Errorf("parse webhook sync header: %w", err)
}
}
if webhookSync {
// Synchronous mode has been requested.
if w.enableSyncMode {
err := next(c)
if err != nil {
if errors.Is(err, api.ErrNoOutputFile) {