We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I stumbled upon the issue when developing with my server with veb but the problem lies deeper, in net/urllib
veb
net/urllib
The parsing logic does not handle well URLs that contain multiple consecutive slashes.
For example:
http://localhost:8080/another.html => OK http://localhost:8080//another.html => erroneous parsing http://localhost:8080//and///another.html => erroneous parsing
One way to see it in action is this:
cd v/examples/veb/static_website v run server.v
Go to http://localhost:8080/another.html (SUCCESS) Go to http://localhost:8080//another.html (Error 404)
The same page loads regardless of the slashes
https://github.com/vlang/v/issues
is the same as
https://github.com/vlang//v//issues
Error 404 or some other page is loaded (depending on if the result of the parsing points by luck to a different page)
The function
fn parse_url(rawurl string, via_request bool) !URL
under vlib/net/urllib/urllib.v
vlib/net/urllib/urllib.v
does not handle via_request=false links correctly
via_request=false
In the above example it will parse "another.html" as the authority part (which is wrong)
No response
V 0.4.8 e4d24e8
V full version: V 0.4.8 e4d24e8 OS: linux, Ubuntu 22.04.5 LTS Processor: 8 cpus, 64bit, little endian, Intel(R) Core(TM) i7-3630QM CPU @ 2.40GHz getwd: /home/bill/Documents/opt/v/examples/veb/static_website vexe: /home/bill/Documents/opt/v/v vexe mtime: 2024-11-24 08:13:43 vroot: OK, value: /home/bill/Documents/opt/v VMODULES: OK, value: /home/bill/.vmodules VTMP: OK, value: /tmp/v_1000 Git version: git version 2.34.1 Git vroot status: 0.4.4-1912-ge4d24e89-dirty .git/config present: true CC version: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 emcc version: N/A thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9
Huly®: V_0.6-21399
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
I stumbled upon the issue when developing with my server with
veb
but the problem lies deeper, innet/urllib
The parsing logic does not handle well URLs that contain multiple consecutive slashes.
For example:
http://localhost:8080/another.html => OK
http://localhost:8080//another.html => erroneous parsing
http://localhost:8080//and///another.html => erroneous parsing
Reproduction Steps
One way to see it in action is this:
Go to http://localhost:8080/another.html (SUCCESS)
Go to http://localhost:8080//another.html (Error 404)
Expected Behavior
The same page loads regardless of the slashes
For example:
https://github.com/vlang/v/issues
is the same as
https://github.com/vlang//v//issues
Current Behavior
Error 404 or some other page is loaded (depending on if the result of the parsing points by luck to a different page)
Possible Solution
The function
under
vlib/net/urllib/urllib.v
does not handle
via_request=false
links correctlyIn the above example it will parse "another.html" as the authority part (which is wrong)
Additional Information/Context
No response
V version
V 0.4.8 e4d24e8
Environment details (OS name and version, etc.)
Huly®: V_0.6-21399
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: