mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 20:52:14 +01:00
fix: only use webhook ports between 1025 and 65536 (#346)
- ports between 0 and 1024 can only be used by root in some OS Co-authored-by: Jana Storch <jana.storch@dpdhl.com>
This commit is contained in:
@@ -111,7 +111,7 @@ func TestHttpErrorHandler(t *testing.T) {
|
|||||||
|
|
||||||
func() {
|
func() {
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
webhookPort := rand.Intn(65535-1+1) + 1
|
webhookPort := rand.Intn(65535 - 1025 + 1) + 1025
|
||||||
|
|
||||||
tc.webhookClient.errorURL = fmt.Sprintf(tc.webhookClient.errorURL, webhookPort)
|
tc.webhookClient.errorURL = fmt.Sprintf(tc.webhookClient.errorURL, webhookPort)
|
||||||
|
|
||||||
@@ -825,7 +825,7 @@ func TestContextMiddlewareWithWebhook(t *testing.T) {
|
|||||||
webhook.HidePort = true
|
webhook.HidePort = true
|
||||||
|
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
webhookPort := rand.Intn(65535-1+1) + 1
|
webhookPort := rand.Intn(65535 - 1025 + 1) + 1025
|
||||||
|
|
||||||
if tc.autoWebhookURLs {
|
if tc.autoWebhookURLs {
|
||||||
c.Request().Header.Set("Gotenberg-Webhook-Url", fmt.Sprintf("http://localhost:%d/", webhookPort))
|
c.Request().Header.Set("Gotenberg-Webhook-Url", fmt.Sprintf("http://localhost:%d/", webhookPort))
|
||||||
|
|||||||
Reference in New Issue
Block a user