From 5372a7f63e87c638b2cf5449ae21de7d2540987e Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 1 May 2019 00:46:49 +0300 Subject: [PATCH] #1: Multiple requests for signed textures with proxying results in the chrly property being duplicated. --- http/signed_textures.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/http/signed_textures.go b/http/signed_textures.go index 34002a5..0a67243 100644 --- a/http/signed_textures.go +++ b/http/signed_textures.go @@ -30,7 +30,11 @@ func (cfg *Config) SignedTextures(response http.ResponseWriter, request *http.Re }, } } else if request.URL.Query().Get("proxy") != "" { - responseData = <-cfg.MojangTexturesQueue.GetTexturesForUsername(username) + response := <-cfg.MojangTexturesQueue.GetTexturesForUsername(username) + if response != nil { + clone := *response + responseData = &clone + } } if responseData == nil { @@ -45,5 +49,5 @@ func (cfg *Config) SignedTextures(response http.ResponseWriter, request *http.Re responseJson, _ := json.Marshal(responseData) response.Header().Set("Content-Type", "application/json") - response.Write(responseJson) + _, _ = response.Write(responseJson) }