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

[1.x] Fix broken behavior for 308 redirects #274

Merged
merged 2 commits into from
Dec 6, 2020
Merged

Conversation

jyn514
Copy link
Contributor

@jyn514 jyn514 commented Dec 6, 2020

Previously, this would unconditionally panic:

thread '<unnamed>' panicked at 'attempt to subtract with overflow', /home/joshua/src/rust/ureq/src/unit.rs:244:59
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Follow-up to #253. Sorry for not testing earlier!

Previously, this would unconditionally panic:

```
thread '<unnamed>' panicked at 'attempt to subtract with overflow', /home/joshua/src/rust/ureq/src/unit.rs:244:59
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
@jyn514 jyn514 changed the title Fix broken behavior for 308 redirects [1.x] Fix broken behavior for 308 redirects Dec 6, 2020
@jsha
Copy link
Collaborator

jsha commented Dec 6, 2020

Thanks for the fix! Can you add a unittest that would detect the bug?

@jsha
Copy link
Collaborator

jsha commented Dec 6, 2020

By the way, for the main branch, #275 refactors the redirect-counting code and happens to fix this.

@jyn514
Copy link
Contributor Author

jyn514 commented Dec 6, 2020

Done, I made sure it failed on master.

@jsha jsha merged commit 23f9b47 into algesten:1.x Dec 6, 2020
@jyn514 jyn514 deleted the 1.x branch December 6, 2020 04:31
@jsha
Copy link
Collaborator

jsha commented Dec 6, 2020

Great, I'll cut a release with the fix.

@jsha
Copy link
Collaborator

jsha commented Dec 6, 2020

Published: https://crates.io/crates/ureq/1.5.4

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