Skip to content

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

@tmikeschu

Description

@tmikeschu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions