Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request library throws 403 because user-agent is missing (e.g., cloudfront url with s3 object) #166

Open
tmikeschu opened this issue Sep 27, 2024 · 0 comments

Comments

@tmikeschu
Copy link

tmikeschu commented Sep 27, 2024

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

  1. fetch(url) is a 200
  2. request(url) is a 403
  3. 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

Image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant