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

Call parseUnsafeRelativePath() on non-relative paths. #273

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

lz-censys
Copy link
Contributor

While attempting to use httpx, I found that it was not able to process URLs like https://127.0.0.1/%25; this is because the base golang URL parser will discard those chars as invalid.

Fortunately, this library has another mechanism that can be called for these specific cases, but unfortunately this function was not being called for non-relative URLs.

This attempts to fix that issue but calls parseUnsafeRelativePath when non-relative and only when the unsafe boolean is passed to ParseURL.

Let me know if there are any issues.

While attempting to use httpx I found that it was not able to process
URLs like "https://127.0.0.1/%25", this is because the base golang url
parser will discard those chars as invalid.

Fortunately, it seems as if this library has another mechanism that can
be called for these specific cases, but unfortunately this function was
not being called for non-relative URLs.

This attempts to fix that issue but calling parseUnsafeRelativePath when
non-relative and only when the unsafe boolean is passed to ParseURL.
@Mzack9999 Mzack9999 self-requested a review October 26, 2023 11:40
@Mzack9999 Mzack9999 merged commit 69cdf78 into projectdiscovery:main Oct 26, 2023
7 checks passed
tarunKoyalwar added a commit that referenced this pull request Oct 31, 2023
ehsandeep pushed a commit that referenced this pull request Nov 2, 2023
* readutil: add ConnReadN function

* misc improvements

* revert #273 with explaination

* introduce: NContext

* misc changes

* use context / set timeout

* bump go -> 1.21

* hide/accept timeout error if we get any data

* fix accepted error timeout logic

* fix race condition

* improved explaination of testcase

* include pollerr in IsTimeout()
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