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

Ignore Expires header of 0 and -1 for error log #282

Closed
floens opened this issue Jul 17, 2019 · 2 comments
Closed

Ignore Expires header of 0 and -1 for error log #282

floens opened this issue Jul 17, 2019 · 2 comments
Milestone

Comments

@floens
Copy link
Contributor

floens commented Jul 17, 2019

When processing the Expires header in HttpHeaderParser, and when the value is invalid it logs an error.

https://github.com/google/volley/blob/master/src/main/java/com/android/volley/toolbox/HttpHeaderParser.java#L138

However, Cloudflare often sets this field to 0 or -1, causing the log to be spammed with warnings. I'd rather see the warning not being logged at all, of a simple filter for 0 and -1.

@jpd236
Copy link
Collaborator

jpd236 commented Jul 18, 2019

This has come up before (#223). As noted then, 0 and -1 are invalid values according to the HTTP RFC, as far as I can tell. But the RFC does say this:

"A cache recipient MUST interpret invalid date formats, especially the value "0", as representing a time in the past (i.e., "already expired")."

which matches Volley's behavior. The only contention here seems to be the logspam about the warnings, and given the frequency of reports about it, I suppose we should just go ahead and accept that these invalid date formats are common enough in practice to not be worth logging warnings about.

@jpd236 jpd236 added this to the 1.2.0 milestone Jul 18, 2019
@jpd236
Copy link
Collaborator

jpd236 commented Jul 18, 2019

A pull request would be welcome here. My proposal would be to drop the message to .v (verbose) for 0 and -1 and keep it at .e otherwise, and we can see if that makes folks happy.

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