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: escape URL path to prevent issues with unescaped characters when use webhook #1334

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

secriy
Copy link
Contributor

@secriy secriy commented Dec 6, 2024

What does this PR do?

This PR fixes an issue with the URL path not being properly escaped when constructing an HTTP request. It updates the code to use u.EscapedPath() instead of u.Path to ensure that special characters in the URL path are correctly escaped.

Motivation

I want to add a newline character (%0A) to the URL path. In the current implementation (master branch), there is a hacky workaround that uses %250A (where %0A would be expected) to achieve this. This behavior is incorrect and caused by the lack of proper escaping for the path. By switching to u.EscapedPath(), newline characters and other special characters are correctly encoded, eliminating the need for double-encoding workarounds.

Additional Notes

None

@secriy secriy changed the title fix: escape URL path to prevent issues with unescaped characters fix: escape URL path to prevent issues with unescaped characters when use webhook Dec 6, 2024
@jeessy2 jeessy2 merged commit e0dc641 into jeessy2:master Dec 7, 2024
2 checks passed
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.

2 participants