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

urllib.parse was unable to parse relative address #21061

Open
donald001 opened this issue Mar 19, 2024 · 0 comments
Open

urllib.parse was unable to parse relative address #21061

donald001 opened this issue Mar 19, 2024 · 0 comments
Labels
Bug This tag is applied to issues which reports bugs. Unit: vlib Bugs/feature requests, that are related to the vlib.

Comments

@donald001
Copy link

donald001 commented Mar 19, 2024

Describe the bug

net.urllib can parse absolute http URL, but failed to parse relative path.

Reproduction Steps

Here is the code:

import net.urllib
fn main(){
	u:=urllib.parse("https://vip.ffzy-online4.com/20230205/6094_d2720761/index.m3u8")!.resolve_reference(urllib.parse("2000k/hls/mixed.m3u8")!)!
	println(u.str())
}

Expected Behavior

Here is the java code:

System.out.println(URI.create("https://vip.ffzy-online4.com/20230205/6094_d2720761/index.m3u8").resolve("2000k/hls/mixed.m3u8"));

The url should be resolved just as the java result shows: "https://vip.ffzy-online4.com/20230205/6094_d2720761/2000k/hls/mixed.m3u8"

Current Behavior

We just got the error: "V panic: result not set (net.urllib.parse: failed parsing url (2000k/hls/mixed.m3u8))"

Possible Solution

fix the "parse" method

Additional Information/Context

No response

V version

0.4.4

Environment details (OS name and version, etc.)

V full version: V 0.4.4 a36c693
OS: windows, Microsoft Windows 11 רҵ�� v22621 64 λ
Processor: 20 cpus, 64bit, little endian,

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.

@donald001 donald001 added the Bug This tag is applied to issues which reports bugs. label Mar 19, 2024
@felipensp felipensp added the Unit: vlib Bugs/feature requests, that are related to the vlib. label Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs. Unit: vlib Bugs/feature requests, that are related to the vlib.
Projects
None yet
Development

No branches or pull requests

2 participants