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

fix: Handle queries and fragments in sourcemap URLs #1734

Closed
wants to merge 2 commits into from

Conversation

loewenheim
Copy link
Contributor

This manually strips away query strings and fragments from source mapping URLs, making sure that the sourcemap file is correctly associated with the source file.

@loewenheim loewenheim self-assigned this Sep 5, 2023
@loewenheim loewenheim linked an issue Sep 5, 2023 that may be closed by this pull request
@loewenheim
Copy link
Contributor Author

I added a query parameter and a fragment to some injection test fixtures.

@@ -327,7 +327,15 @@ impl SourceMapProcessor {
};

let sourcemap_url = match discover_sourcemaps_location(contents) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we move this to this function?

I’m a bit unsure, as in symbolicator when we scrape the sourceMappingURL from the file because we had no bundle "header" to take it from, we have to strip these when looking up the sourcemap in the bundles we have, but having these present in case we fall back to scraping might actually be beneficial.

When in doubt, I would rather just strip them reliably as early as possible.

@loewenheim
Copy link
Contributor Author

We'll fix this on the symbolic end, see getsentry/symbolic#809.

@loewenheim loewenheim closed this Sep 5, 2023
@loewenheim loewenheim mentioned this pull request Sep 6, 2023
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

Successfully merging this pull request may close these issues.

Correctly handle source mapping URLs with query strings &c.
2 participants