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

support path-as-is #387

Closed
wants to merge 2 commits into from
Closed

support path-as-is #387

wants to merge 2 commits into from

Conversation

zuisong
Copy link
Contributor

@zuisong zuisong commented Oct 30, 2024

A clever method to avoid URL normalization. see epi052/feroxbuster#878 (comment)

Here's a cheeky way to implement path-as-is.

image

@zuisong
Copy link
Contributor Author

zuisong commented Oct 30, 2024

It does not support the "./" path. This implementation differs from httpie and curl.

image

src/cli.rs Outdated
.map(|it| it.1)
.unwrap_or(url_string);
let path = after_scheme.split_once('/').unwrap().1;
let mut url = Url::from_file_path(format!("/{}", path)).unwrap();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special handling is required for the Windows system.

@zuisong
Copy link
Contributor Author

zuisong commented Oct 31, 2024

The effect cannot be achieved like curl or xh, so it has been temporarily disabled.

@zuisong zuisong closed this Oct 31, 2024
@blyxxyz
Copy link
Collaborator

blyxxyz commented Oct 31, 2024

Interesting (and too bad you can't make it work).

Hyper uses a Uri type that doesn't have this limitation. But I don't think we can access it directly.

reqwest issue: seanmonstar/reqwest#2396

@zuisong
Copy link
Contributor Author

zuisong commented Oct 31, 2024

Indeed, this is quite sad.

This implementation currently does not work on the Windows platform and does not support "./" paths.

This feature can only be implemented after changes are made upstream.

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