Open talset opened 2 years ago
It’s a bit of a hack — actually it’s a pretty big one 😂 — but if you find yourself in need a workaround, as we did, you can patch the underlying library:
const bhttp = require("bhttp");
const oldRequest = bhttp.request;
bhttp.request = function() {
const [ url, options, callback ] = arguments;
// Modify request options.
// https://git.cryto.net/joepie91/node-bhttp/src/branch/master/lib/bhttp.js#L886
options.headers.accept = "*/*";
return oldRequest.apply(this, arguments);
};
https://github.com/pulumi/docs/blob/master/scripts/link-checker/check-links.js#L53
For a few days we receive 403 on URL such https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
To fix the issue, we need to provide
Accept-Encoding
to blcDescribe the solution you'd like Ideal it would be nice to be able to provide custom headers
Describe alternatives you've considered Adding a flag such as
--user-agent
to provider--accept-encoding
tooAdditional context