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

Prevent double slashes with HTTP proxy #2377

Merged
merged 1 commit into from
Apr 8, 2023

Conversation

kangalio
Copy link
Collaborator

@kangalio kangalio commented Apr 7, 2023

Fixes #2322

Probably wouldn't have caused because double slashes are treated by HTTP servers as single slashes in my experience.

After a bit of back and forth I opted not to use reqwest methods. Parsing the given proxy in HttpBuilder into an Url directly means the builder method returns Result (or panics) which is both ugly. Also, Url's methods yield the scheme and domain both as &str, so we would still just have a string in the internal proxy field instead of a type-safe value. So I kept the current simple solution that gets the job done and just added the fix

Fixes serenity-rs#2322

Probably wouldn't have caused because double slashes are treated by HTTP servers as single slashes in my experience.

After a bit of back and forth I opted not to use reqwest methods. Parsing the given proxy in HttpBuilder into an Url directly means the builder method returns Result (or panics) which is both ugly. Also, Url's methods yield the scheme and domain both as &str, so we would still just have a string in the internal proxy field instead of a type-safe value. So I kept the current simple solution that gets the job done and just added the fix
@github-actions github-actions bot added the http Related to the `http` module. label Apr 7, 2023
@arqunis arqunis added the fix A solution to an existing bug. label Apr 8, 2023
@arqunis arqunis merged commit c628b15 into serenity-rs:next Apr 8, 2023
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request May 18, 2023
Fixes serenity-rs#2322

Probably wouldn't have caused because double slashes are treated by HTTP
servers as single slashes in my experience.

After a bit of back and forth I opted not to use reqwest methods. Parsing the
given proxy in `HttpBuilder` into an `Url` directly means the builder method
returns `Result` (or panics) which is both ugly. Also, `Url`'s methods yield the
scheme and domain both as `&str`, so we would still just have a string in the
internal proxy field instead of a type-safe value. So I kept the current simple
solution that gets the job done and just added the fix.
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request May 30, 2023
Fixes serenity-rs#2322

Probably wouldn't have caused because double slashes are treated by HTTP
servers as single slashes in my experience.

After a bit of back and forth I opted not to use reqwest methods. Parsing the
given proxy in `HttpBuilder` into an `Url` directly means the builder method
returns `Result` (or panics) which is both ugly. Also, `Url`'s methods yield the
scheme and domain both as `&str`, so we would still just have a string in the
internal proxy field instead of a type-safe value. So I kept the current simple
solution that gets the job done and just added the fix.
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Sep 21, 2023
Fixes serenity-rs#2322

Probably wouldn't have caused because double slashes are treated by HTTP
servers as single slashes in my experience.

After a bit of back and forth I opted not to use reqwest methods. Parsing the
given proxy in `HttpBuilder` into an `Url` directly means the builder method
returns `Result` (or panics) which is both ugly. Also, `Url`'s methods yield the
scheme and domain both as `&str`, so we would still just have a string in the
internal proxy field instead of a type-safe value. So I kept the current simple
solution that gets the job done and just added the fix.
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 17, 2023
Fixes serenity-rs#2322

Probably wouldn't have caused because double slashes are treated by HTTP
servers as single slashes in my experience.

After a bit of back and forth I opted not to use reqwest methods. Parsing the
given proxy in `HttpBuilder` into an `Url` directly means the builder method
returns `Result` (or panics) which is both ugly. Also, `Url`'s methods yield the
scheme and domain both as `&str`, so we would still just have a string in the
internal proxy field instead of a type-safe value. So I kept the current simple
solution that gets the job done and just added the fix.
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 24, 2023
Fixes serenity-rs#2322

Probably wouldn't have caused because double slashes are treated by HTTP
servers as single slashes in my experience.

After a bit of back and forth I opted not to use reqwest methods. Parsing the
given proxy in `HttpBuilder` into an `Url` directly means the builder method
returns `Result` (or panics) which is both ugly. Also, `Url`'s methods yield the
scheme and domain both as `&str`, so we would still just have a string in the
internal proxy field instead of a type-safe value. So I kept the current simple
solution that gets the job done and just added the fix.
arqunis pushed a commit to arqunis/serenity that referenced this pull request Oct 24, 2023
Fixes serenity-rs#2322

Probably wouldn't have caused because double slashes are treated by HTTP
servers as single slashes in my experience.

After a bit of back and forth I opted not to use reqwest methods. Parsing the
given proxy in `HttpBuilder` into an `Url` directly means the builder method
returns `Result` (or panics) which is both ugly. Also, `Url`'s methods yield the
scheme and domain both as `&str`, so we would still just have a string in the
internal proxy field instead of a type-safe value. So I kept the current simple
solution that gets the job done and just added the fix.
arqunis pushed a commit to arqunis/serenity that referenced this pull request Oct 24, 2023
Fixes serenity-rs#2322

Probably wouldn't have caused because double slashes are treated by HTTP
servers as single slashes in my experience.

After a bit of back and forth I opted not to use reqwest methods. Parsing the
given proxy in `HttpBuilder` into an `Url` directly means the builder method
returns `Result` (or panics) which is both ugly. Also, `Url`'s methods yield the
scheme and domain both as `&str`, so we would still just have a string in the
internal proxy field instead of a type-safe value. So I kept the current simple
solution that gets the job done and just added the fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A solution to an existing bug. http Related to the `http` module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants