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

too many follow-up requests problem #3827

Closed
MetaiR opened this issue Feb 5, 2018 · 5 comments
Closed

too many follow-up requests problem #3827

MetaiR opened this issue Feb 5, 2018 · 5 comments
Labels
bug Bug in existing code needs info More information needed from reporter
Milestone

Comments

@MetaiR
Copy link

MetaiR commented Feb 5, 2018

hello,
recording to this issue it looks like OkHttp has a problem with status code 408.
just want to put it here to be fixed.

@yschimke
Copy link
Collaborator

yschimke commented Feb 6, 2018

Can you provide a sample of the response headers you are sending with the 408? Or a reproduction test case?

There is changed handling of 408 in 3.10, which has not yet been released. I don't think it fixes it however. #3753 But even if that doesn't help you can see examples in that PR of how to make a reproduction test case.

Also relevant is a fix in August for 408 handling #3500

@yschimke yschimke added bug Bug in existing code needs info More information needed from reporter labels Feb 6, 2018
@MetaiR
Copy link
Author

MetaiR commented Feb 6, 2018

@yschimke
something like this

General:
Request URL:http://exampledomain:port/api
Request Method:GET
Status Code:408
Remote Address:exampledomain:port
Referrer Policy:no-referrer-when-downgrade


Response-Headers:
Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:http://example-server-ip:port
Access-Control-Expose-Headers:Set-Cookie
Content-Language:en
Content-Length:X
Content-Type:text/html;charset=utf-8
Date:Tue, 06 Feb 2018 23:12:09 GMT
Server:Apache TomEE
Vary:Origin

I'm not quite sure because we changed the status code but just status code and other things are remained so it should like the above (I copied the exact response from chrome, hope it's become useful)

@swankjesse swankjesse modified the milestones: 3.11, 3.10 Feb 18, 2018
@swankjesse
Copy link
Member

Fixed in 3.10.

@aleeee
Copy link

aleeee commented Aug 18, 2020

it still happens on version 3.14.9
@OverRide
public Request authenticate(Route route, Response response) throws IOException {
// Request a new access token if needed
if (!isTokenStillValid()) {
try {
getAccessToken();
} catch (HttpException | ApiException e) {
log.error("Error authenticating request {}", e.getMessage());
throw new IOException(e.getCause());
}
}
if(response.request().header("Authorization") != null && response.request().header("Authorization").equals(token.getValue()))
return null;
Request request = response.request().newBuilder().removeHeader("Authorization").build();

	return request.newBuilder().addHeader("Authorization", "Bearer " + token.getValue()).build();
	
}

@aumarbello
Copy link

@aleeee Check out this solution: https://stackoverflow.com/a/63512049/8026243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in existing code needs info More information needed from reporter
Projects
None yet
Development

No branches or pull requests

5 participants