fix(chromium): harden outbound URL handling

This commit is contained in:
Julien Neuhart
2026-04-21 20:05:38 +02:00
parent 7729bd0590
commit 35f1a990a6
11 changed files with 1076 additions and 55 deletions

View File

@@ -25,6 +25,7 @@ import (
type eventRequestPausedOptions struct {
allowList, denyList []*regexp2.Regexp
allowPrivateIPs bool
allowedFilePrefixes []string
extraHttpHeaders []ExtraHttpHeader
}
@@ -52,7 +53,7 @@ func listenForEventRequestPaused(ctx context.Context, logger *slog.Logger, optio
return
}
err := gotenberg.FilterOutboundURL(ctx, e.Request.URL, options.allowList, options.denyList, deadline)
err := gotenberg.FilterOutboundURL(ctx, e.Request.URL, options.allowList, options.denyList, deadline, gotenberg.WithAllowPrivateIPs(options.allowPrivateIPs))
if err != nil {
logger.WarnContext(ctx, err.Error())
allow = false