Jelly V
Jelly V
CDCloudflare Developers
Created by Jelly V on 9/9/2024 in #workers-help
Headers with dots in the key are removed when I make a fetch request from a worker
I'm trying to call an API that requires me to put 4 specific headers in the request with a dot in in the name I correctly add the headers When I run it locally everything works. Then I deploy and it gives an error. I tried sending the requests to requestbin and I notice some of my headers are gone Request from worker running locally:
host enb5450qn5v4.x.pipedream.net
x-amzn-trace-id Root=1-66df741a-6cee43f22bdb39c5376a097a
accept application/json
wm_consumer.id REDACTED
wm_consumer.intimestamp REDACTED
wm_sec.auth_signature REDACTED
wm_sec.key_version 1
x-source Cloudflare-Workers
host enb5450qn5v4.x.pipedream.net
x-amzn-trace-id Root=1-66df741a-6cee43f22bdb39c5376a097a
accept application/json
wm_consumer.id REDACTED
wm_consumer.intimestamp REDACTED
wm_sec.auth_signature REDACTED
wm_sec.key_version 1
x-source Cloudflare-Workers
Request from worker running in prod:
x-forwarded-for 2a06:98c0:3600::103
host enb5450qn5v4.x.pipedream.net
x-amzn-trace-id Root=1-66df7471-6d579b8458a7a54a7154c31b
cf-worker patient-sunset-0f3f.workers.dev
cf-connecting-ip 2a06:98c0:3600::103
accept-encoding gzip, br
cf-ray 8c0a8f66620883dd-BRU
cf-visitor {"scheme":"https"}
cf-ew-via 15
cdn-loop cloudflare; loops=1; subreqs=1
accept application/json
x-source Cloudflare-Workers
x-forwarded-for 2a06:98c0:3600::103
host enb5450qn5v4.x.pipedream.net
x-amzn-trace-id Root=1-66df7471-6d579b8458a7a54a7154c31b
cf-worker patient-sunset-0f3f.workers.dev
cf-connecting-ip 2a06:98c0:3600::103
accept-encoding gzip, br
cf-ray 8c0a8f66620883dd-BRU
cf-visitor {"scheme":"https"}
cf-ew-via 15
cdn-loop cloudflare; loops=1; subreqs=1
accept application/json
x-source Cloudflare-Workers
Only the Accept and the X-Source headers which I set manually are present. All my WM_ prefixed headers are gone.
I tested this with all kinds of variations, and only the headers with a "." in the name get removed. Dashes, underscores, all work. I tried creating my headers like an object. I tried making a new Header() and appending them 1 by one and it doesn't change anything. Any fix around this?
2 replies