apify / got-scraping

HTTP client made for scraping based on got.
422 stars 32 forks source link

force header case for a single header #134

Open yovanoc opened 4 months ago

yovanoc commented 4 months ago

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

B4nan commented 4 months ago

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

yovanoc commented 4 months ago

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?

B4nan commented 4 months ago

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