`request` library throws 403 because user-agent is missing (e.g., cloudfront url with s3 object)
Environment
What version are you running? Etc.
Steps to Reproduce
Example bundle to validate: https://app-static-prod.posthog.com/static/index-ZPBKKMYQ.js
https://sourcemaps.io/report/1727455456490_https%3A%2F%2Fapp-static-prod.posthog.com%2Fstatic%2Findex-ZPBKKMYQ.js
-
fetch(url)is a 200 -
request(url)is a 403 -
request(url, { headers: { 'User-Agent': 'foo' } })is a 200
Expected Result
Sourcemap should be valid (I can visit both the bundle and the referenced sourceMappingURL in a browser.
Actual Result
I have run these urls using request myself to see that the response code is 403.
Since request is deprecated, maybe use a more modern fetch mechanism? Or just add a user agent header.
Also running into this issue. I have cloudflare rules to block requests that have either a missing user-agent header or a blank one. I'd prefer to leave that rule in place