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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user