got-scraping icon indicating copy to clipboard operation
got-scraping copied to clipboard

force header case for a single header

Open yovanoc opened this issue 1 year ago • 3 comments

is there a way to override per-request header casing (e.g choosing a uppercase for a single header even when http2) ?

yovanoc avatar Mar 04 '24 13:03 yovanoc

i think the headers are normalized directly in got (to lower case), sounds like a wontfix to me.

B4nan avatar Mar 04 '24 13:03 B4nan

In got? I think this is happening here in got-scraping: https://github.com/apify/got-scraping/blob/5c78d35ef191f6cf8c37d7a851a48f715b761f45/src/hooks/browser-headers.ts#L19

So the only way will be to override got-scraping and add a before request hook to handle specific case like this?

yovanoc avatar Mar 04 '24 14:03 yovanoc

Yes but even if we hadn't done that, it would have happened on the lower level, as got does the same

https://github.com/sindresorhus/got/issues/1335

B4nan avatar Mar 04 '24 14:03 B4nan