1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Improve image proxy

This commit is contained in:
Frédéric Guillot 2017-11-21 23:09:01 -08:00
parent 99dfbdbb47
commit 38941f58cf
2 changed files with 21 additions and 9 deletions

View file

@ -46,6 +46,11 @@ func (r *Response) Redirect(path string) {
http.Redirect(r.writer, r.request, path, http.StatusFound)
}
// NotModified sends a response with a 304 status code.
func (r *Response) NotModified() {
r.writer.WriteHeader(http.StatusNotModified)
}
// Cache returns a response with caching headers.
func (r *Response) Cache(mimeType, etag string, content []byte, duration time.Duration) {
r.writer.Header().Set("Content-Type", mimeType)