Open Cooya opened 2 years ago
I tried using a hook without success :
let { gotScraping } = require('got-scraping');
gotScraping = gotScraping.extend({
hooks: {
beforeRequest: [
options => {
options.headers['myheader'] = options.headers['MyHeader'];
delete options.headers['myheader'];
}
]
}
});
I am sending requests to a server which does not respect HTTP specification specifying that headers should be case-insensitive. The problem is that with got-scraping, a header named "MyHeader" will be renamed "Myheader"...
How can I send a header whose name will be kept untouched ?