2 Commits
1.0.5 ... 1.0.6

Author SHA1 Message Date
7f744d04b0 Merge pull request 'fix: trim query parameters from URL path in ServeHTTP to ensure cache key correctness' (#4) from fix/query-params into main
All checks were successful
Release Tag / release (push) Successful in 17s
Reviewed-on: s1d3sw1ped/SteamCache2#4
2025-07-13 10:43:21 +00:00
6c98d03ae7 fix: trim query parameters from URL path in ServeHTTP to ensure cache key correctness
All checks were successful
PR Check / check-and-test (pull_request) Successful in 16s
2025-07-13 05:42:07 -05:00

View File

@@ -218,6 +218,10 @@ func (sc *SteamCache) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
if strings.HasPrefix(r.URL.String(), "/depot/") {
// trim the query parameters from the URL path
// this is necessary because the cache key should not include query parameters
r.URL.Path = strings.Split(r.URL.Path, "?")[0]
tstart := time.Now()
defer func() { responseTime.Observe(time.Since(tstart).Seconds()) }()