mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 04:12:16 +01:00
adding custom headers for remoteURL
This commit is contained in:
@@ -18,17 +18,13 @@ func TestRemoteURLCustomHeaders(t *testing.T) {
|
||||
customHeaderValue := "bar"
|
||||
customHeaderCanonicalRealKey := "Foo"
|
||||
customHeaderCanonicalKey := http.CanonicalHeaderKey(fmt.Sprintf("%s%s", RemoteURLCustomHeaderCanonicalBaseKey, customHeaderCanonicalRealKey))
|
||||
r.WithCustomHeader(customHeaderCanonicalKey, []string{customHeaderValue})
|
||||
r.WithCustomHeader("Bar", []string{"Bar"})
|
||||
expected := map[string][]string{
|
||||
customHeaderCanonicalRealKey: []string{
|
||||
customHeaderValue,
|
||||
},
|
||||
r.WithCustomHeader(customHeaderCanonicalKey, customHeaderValue)
|
||||
r.WithCustomHeader("Bar", "Bar")
|
||||
expected := map[string]string{
|
||||
customHeaderCanonicalRealKey: customHeaderValue,
|
||||
}
|
||||
notExpected := map[string][]string{
|
||||
customHeaderCanonicalKey: []string{
|
||||
customHeaderValue,
|
||||
},
|
||||
notExpected := map[string]string{
|
||||
customHeaderCanonicalKey: customHeaderValue,
|
||||
}
|
||||
v := RemoteURLCustomHeaders(r)
|
||||
assert.Equal(t, expected, v)
|
||||
@@ -44,17 +40,13 @@ func TestWebhookURLCustomHeaders(t *testing.T) {
|
||||
customHeaderValue := "bar"
|
||||
customHeaderCanonicalRealKey := "Foo"
|
||||
customHeaderCanonicalKey := http.CanonicalHeaderKey(fmt.Sprintf("%s%s", WebhookURLCustomHeaderCanonicalBaseKey, customHeaderCanonicalRealKey))
|
||||
r.WithCustomHeader(customHeaderCanonicalKey, []string{customHeaderValue})
|
||||
r.WithCustomHeader("Bar", []string{"Bar"})
|
||||
expected := map[string][]string{
|
||||
customHeaderCanonicalRealKey: []string{
|
||||
customHeaderValue,
|
||||
},
|
||||
r.WithCustomHeader(customHeaderCanonicalKey, customHeaderValue)
|
||||
r.WithCustomHeader("Bar", "Bar")
|
||||
expected := map[string]string{
|
||||
customHeaderCanonicalRealKey: customHeaderValue,
|
||||
}
|
||||
notExpected := map[string][]string{
|
||||
customHeaderCanonicalKey: []string{
|
||||
customHeaderValue,
|
||||
},
|
||||
notExpected := map[string]string{
|
||||
customHeaderCanonicalKey: customHeaderValue,
|
||||
}
|
||||
v := WebhookURLCustomHeaders(r)
|
||||
assert.Equal(t, expected, v)
|
||||
|
||||
Reference in New Issue
Block a user