Update content type validation in ServeHTTP method for Steam files

- Changed expected Content-Type from "application/octet-stream" to "application/x-steam-chunk" to align with Steam's file specifications.
- Enhanced warning message for unexpected content types to provide clearer context for debugging.
This commit is contained in:
2025-09-02 05:48:24 -05:00
parent 4a4579b0f3
commit ee6fc32a1a

View File

@@ -502,13 +502,13 @@ func (sc *SteamCache) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
// Method 2: Content-Type Validation (Steam files should be binary)
// Method 2: Content-Type Validation (Steam files should be application/x-steam-chunk)
contentType := resp.Header.Get("Content-Type")
if contentType != "" && !strings.Contains(contentType, "application/octet-stream") {
if contentType != "" && !strings.Contains(contentType, "application/x-steam-chunk") {
logger.Logger.Warn().
Str("url", req.URL.String()).
Str("content_type", contentType).
Msg("Unexpected content type from Steam")
Msg("Unexpected content type from Steam - expected application/x-steam-chunk")
}
// Method 3: Content-Length Validation