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

Handle new hydra login API issue #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/hydra/reqwest_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ impl HydraClient for Client {
Ok(r) => {
if r.status().is_success() {
Ok(())
} else if r.status() == 500 {
// New hydra gives a 302 redirect to a page that ends up with a 500
// Ideally we would not follow the redirect
Copy link
Owner

Choose a reason for hiding this comment

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

It seems to be possible to not follow redirect (https://docs.rs/reqwest/0.10.3/reqwest/redirect/struct.Policy.html#method.none). I think it would be a bit better than returning Ok on 500.
Also, we could ask Hydra people about this behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh nice, I didn't see that part of the reqwest API 👍

Ok(()) // ignore redirect error
} else {
Err(ClientError::Error(format!("{}", r.status())))
}
Expand Down