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:
@@ -13,8 +13,8 @@ const (
|
||||
WebhookURLCustomHeaderCanonicalBaseKey string = "Gotenberg-Webhookurl-"
|
||||
)
|
||||
|
||||
func fetchCustomHeaders(r Resource, baseKey string) map[string][]string {
|
||||
customHeaders := make(map[string][]string)
|
||||
func fetchCustomHeaders(r Resource, baseKey string) map[string]string {
|
||||
customHeaders := make(map[string]string)
|
||||
for key, value := range r.customHeaders {
|
||||
if strings.Contains(key, baseKey) {
|
||||
realKey := strings.Replace(key, baseKey, "", 1)
|
||||
@@ -26,12 +26,12 @@ func fetchCustomHeaders(r Resource, baseKey string) map[string][]string {
|
||||
|
||||
// RemoteURLCustomHeaders is a helper for retrieving
|
||||
// the custom headers for the URL conversion.
|
||||
func RemoteURLCustomHeaders(r Resource) map[string][]string {
|
||||
func RemoteURLCustomHeaders(r Resource) map[string]string {
|
||||
return fetchCustomHeaders(r, RemoteURLCustomHeaderCanonicalBaseKey)
|
||||
}
|
||||
|
||||
// WebhookURLCustomHeaders is a helper for retrieving
|
||||
// the custom headers for the webhook URL.
|
||||
func WebhookURLCustomHeaders(r Resource) map[string][]string {
|
||||
func WebhookURLCustomHeaders(r Resource) map[string]string {
|
||||
return fetchCustomHeaders(r, WebhookURLCustomHeaderCanonicalBaseKey)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user