lox / httpcache

An RFC7234 compliant golang http.Handler for caching HTTP responses
MIT License
264 stars 28 forks source link

Error EOF when first request for a resource is HEAD? #13

Open mpictor opened 9 years ago

mpictor commented 9 years ago

It seems that httpcache logs an error while attempting to cache a resource, if the first/only request is a HEAD. The error comes from handler.go:385.

Also, this line results in a poorly formatted error - when errorf passes the args to the log function, there is no distinction between err and the elements of keys, so the function thinks that the arg for %s is missing. One workaround is

errorf(fmt.Sprintf("error %s storing resources %%#v", err), keys)