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

Comment about bad Expires header doesn't match semantics #10

Open
glasser opened this issue Mar 21, 2018 · 0 comments
Open

Comment about bad Expires header doesn't match semantics #10

glasser opened this issue Mar 21, 2018 · 0 comments

Comments

@glasser
Copy link
Contributor

glasser commented Mar 21, 2018

The code reads:

	if respHeaders.Get("Expires") != "" {
		expiresHeader, err = http.ParseTime(respHeaders.Get("Expires"))
		if err != nil {
			// sometimes servers will return `Expires: 0` or `Expires: -1` to
			// indicate expired content
			expiresHeader = time.Time{}
		}
		expiresHeader = expiresHeader.UTC()
	}

The comment says that Expires:0 or Expires:-1 means expired content. But the code doesn't treat it any differently than no Expires header.

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

1 participant