mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix(web-proxy): fix dashboard cache headers, force path lowercase in metrics
This commit is contained in:
parent
939a727969
commit
372eef72f4
2 changed files with 3 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ func modifyDashResponse(resp *http.Response) error {
|
|||
(strings.HasSuffix(r.URL.Path, ".js") || strings.HasSuffix(r.URL.Path, ".css") || strings.HasSuffix(r.URL.Path, ".map"))
|
||||
|
||||
if is_dash_static_asset && resp.StatusCode == 200 {
|
||||
resp.Header.Add("Cache-Control", "max-age: 604800")
|
||||
resp.Header.Add("Cache-Control", "max-age=31536000, s-maxage=31536000, immutable")
|
||||
}
|
||||
|
||||
return logTimeElapsed(resp)
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ func cleanPath(host, path string) string {
|
|||
return ""
|
||||
}
|
||||
|
||||
path = strings.ToLower(path)
|
||||
|
||||
if !(strings.HasPrefix(path, "/v2") || strings.HasPrefix(path, "/private")) {
|
||||
return ""
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue