Repository navigation
fix(nuxt): Percent-encode public file paths for the span filter - #26817
Merged
Merged
Conversation
Spans store the percent-encoded request path, but the public file list held raw file names. So files with spaces, non-ASCII letters or characters such as % and # still created spans. The list now encodes the paths the way a browser does.
Contributor
size-limit report 📦Compared: db2881e (PR test merge using develop at 1f32728) Against: 1f32728 (develop) · base run #67760 ✅ Baseline matches: this diff contains only this PR's changes.
|
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 2 not successful, 72 successful. See the run.
Successful checks
|
s1gr1d
marked this pull request as ready for review
November 24, 2026 13:55
javascript-sdk-gitflow
Bot
requested review from
RulaKhaled,
chargome and
nicohrubec
November 24, 2026 13:56
nicohrubec
approved these changes
Nov 24, 2026
chargome
approved these changes
Nov 24, 2026
Comment on lines
+43
to
+46
| function toUrlPath(relativeFilePath: string): string { | ||
| const filePath = relativeFilePath.split(path.sep).join('/').replace(/[%#?]/g, encodeURIComponent); | ||
| return new URL(filePath, 'http://localhost/').pathname; | ||
| } |
Member
There was a problem hiding this comment.
Is there no helper for this? 🤔
Anyway just a nit
Member
Author
There was a problem hiding this comment.
No, we don't have a helper for that. We have encodeURI but this leaves the %#? unencoded. And this is about filenames.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Came up in a warden comment but PR was already auto-merged: #26781 (comment)
The Nuxt server SDK now also ignores requests for
public/files with spaces, non-ASCII letters or characters like%and#in their names, for example/my file.pdfor/café.pdf.Why
Spans store the percent-encoded request path (
/my%20file.pdf), but the public file list from #26781 held the raw file names, so these paths never matched. The SDK now encodes the paths with the same URL parsing that setsurl.path, so both sides use the same form.