-
Notifications
You must be signed in to change notification settings - Fork 0
Fix incorrect URL encoding for square brackets in Absolute.encodePath() #48
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
Conversation
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
|
@copilot запусти licenseFormat. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes incorrect percent-encoding of square brackets in Absolute.encodePath() so URIs are generated with RFC-compliant encodings.
Changes:
- Correct
[/]encoding from%91/%93to%5B/%5DinencodePath(). - Add unit tests covering bracket handling across
Absolute.uri(...)andAbsolute.path(...)overloads.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/main/java/com/github/_1c_syntax/utils/Absolute.java | Fixes the actual bracket percent-encoding in encodePath(). |
| src/test/java/com/github/_1c_syntax/utils/AbsoluteTest.java | Adds regression tests for bracket-containing paths/URIs across input variants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assertThat(uri.toString()).doesNotContain("["); | ||
| assertThat(uri.toString()).doesNotContain("]"); | ||
| assertThat(uri.getPath()).contains("[folder]"); | ||
| assertThat(uri.getPath()).endsWith("test[1].bsl"); |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These assertions verify that brackets are absent from the serialized URI, but they don’t explicitly validate that the encoding is the expected %5B / %5D (and not another percent sequence). Consider asserting against uri.getRawPath() (or uri.toString()) that it contains %5B and %5D (optionally also asserting it does not contain %91 / %93) to make the regression test directly cover the bug being fixed.
| assertThat(uri.toString()).doesNotContain("["); | ||
| assertThat(uri.toString()).doesNotContain("]"); | ||
| assertThat(uri.getPath()).contains("[folder]"); | ||
| assertThat(uri.getPath()).endsWith("test[1].bsl"); |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above: this checks that [/] don’t appear in the URI string, but it doesn’t assert the actual percent-encoding used. Adding an assertion on uri.getRawPath()/uri.toString() for %5B and %5D (and/or absence of %91/%93) would make the test directly validate the intended fix.
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
|



encodePath()uses%91and%93instead of%5Band%5Dfor[and]Absolute.javaOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.