-
Notifications
You must be signed in to change notification settings - Fork 56
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
Caddy plugin: request crashes when 304 from upstream #198
Comments
UPD: Actually the requests crash every time the upstream answers with |
Hi @ishuvalov thank you for your report, I'll investigate on it. |
Can you post a reproducible minimal example ? |
Update I can reproduce with this snippet func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("ETag", `"MyCustomETagValueForThis"`)
if r.Header.Get("If-None-Match") == `"MyCustomETagValueForThis"` {
w.WriteHeader(http.StatusNotModified)
return
}
w.Header().Set("ETag", `"MyCustomETagValueForThis"`)
w.WriteHeader(http.StatusOK)
w.Write([]byte("My content body."))
})
http.ListenAndServe(":9000", nil)
} (to keep a trace about that). |
Thank you for the quick reply and for the fix! |
The |
Hi, I'm trying to set up the souin cache as a Caddy plugin. All seem to work fine except one case:
If ETag was sent in the last response and
if-none-match
header (with the ETag value) is present in the current request, and the upstream answers with304
status, the request crashes according to the Caddy log.Could you please look into this? Thanks.
The text was updated successfully, but these errors were encountered: