From ee6fc32a1a22c66cd4cd0a8023ce202bdf660a53 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Tue, 2 Sep 2025 05:48:24 -0500 Subject: [PATCH] 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. --- steamcache/steamcache.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/steamcache/steamcache.go b/steamcache/steamcache.go index b74240b..a673de4 100644 --- a/steamcache/steamcache.go +++ b/steamcache/steamcache.go @@ -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