1
0
Fork 0
forked from forgejo/forgejo

Add ETag header (#15370)

* Add ETag header.

* Comply with RFC 7232.

* Moved logic into httpcache.go

* Changed name.

* Lint

* Implemented If-None-Match list.

* Fixed missing header on *

* Removed weak etag support.

* Removed * support.

* Added unit test.

* Lint

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
KN4CK3R 2021-04-12 16:49:26 +02:00 committed by GitHub
parent 6d2866f20c
commit a35a5b225c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 200 additions and 20 deletions

View file

@ -165,7 +165,7 @@ func (opts *Options) handle(w http.ResponseWriter, req *http.Request, opt *Optio
log.Println("[Static] Serving " + file)
}
if httpcache.HandleEtagCache(req, w, fi) {
if httpcache.HandleFileETagCache(req, w, fi) {
return true
}