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

Does this support Java 1.7? #32

Closed
sammefford opened this issue Jun 28, 2017 · 4 comments
Closed

Does this support Java 1.7? #32

sammefford opened this issue Jun 28, 2017 · 4 comments

Comments

@sammefford
Copy link
Contributor

My code works fine against Java 1.8. But when I test against Java 1.7 every request gets a 401 response and has to resend. Then, if the payload isn't retryable, the resend goes through blank. No error is thrown, it just silently fails to send the payload with the second request. I'll put together steps to reproduce, but I wanted to first ask if this library has been tested with Java 1.7.

@rburgst
Copy link
Owner

rburgst commented Jun 28, 2017

the code is mainly used on android which only supports java 7 (at least up until now). I wouldnt know why there would be a difference running it on java 7 vs 8.

@sammefford
Copy link
Contributor Author

It appears that the problem is because I had this:

DispatchingAuthenticator authenticator = new DispatchingAuthenticator.Builder()
  .with("digest", digestAuthenticator)
  .with("basic", basicAuthenticator)
  .build();

But I needed the connection to stay digest. On Java 1.8 it does. On Java 1.7 it tries basic first every time, then has to retry with digest. Very strange. If the payload is always retryable you may not notice. But once you send a non-retryable (e.g. InputStream) request, you'll notice the second request body is empty. For the moment, a work-around I'm seeing is if I don't add both schemes to the authenticator, and instead just use basic when it's needed and digest when it's needed.

@rburgst
Copy link
Owner

rburgst commented Jul 21, 2017

it should usually pick the one that is requested by the server, check the WWW-Authenticate header of the server.

@rburgst
Copy link
Owner

rburgst commented Jul 21, 2017

is this still an issue with the latest threading fixes?

@rburgst rburgst closed this as completed Feb 9, 2018
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

No branches or pull requests

2 participants