mirror of
				https://github.com/mickael-kerjean/filestash.git
				synced 2025-10-31 18:16:00 +08:00 
			
		
		
		
	fix (caching): obey to the no-cache http header
This commit is contained in:
		| @ -402,7 +402,7 @@ func ServeBundle() func(*App, http.ResponseWriter, *http.Request) { | |||||||
|  |  | ||||||
| 	return func(ctx *App, res http.ResponseWriter, req *http.Request) { | 	return func(ctx *App, res http.ResponseWriter, req *http.Request) { | ||||||
| 		res.Header().Set("Content-Type", "application/javascript") | 		res.Header().Set("Content-Type", "application/javascript") | ||||||
| 		if strings.Contains(req.Header.Get("Accept-Encoding"), "br") { | 		if strings.Contains(req.Header.Get("Accept-Encoding"), "br") && req.Header.Get("Cache-Control") != "no-cache" { | ||||||
| 			res.Header().Set("Content-Encoding", "br") | 			res.Header().Set("Content-Encoding", "br") | ||||||
| 			res.Write(bundleBr) | 			res.Write(bundleBr) | ||||||
| 			return | 			return | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 MickaelK
					MickaelK