From e84e39eeaeaefe34ee1e0278b21e549173f4bbef Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Thu, 21 Dec 2023 19:05:26 +0100 Subject: [PATCH] Pass response status from Chrly to the final response --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 15e6ade..83c8e80 100644 --- a/main.go +++ b/main.go @@ -85,7 +85,14 @@ func main() { return } + if profileResp.StatusCode != http.StatusOK && profileResp.StatusCode != http.StatusNoContent { + // TODO: log response + response.WriteHeader(500) + return + } + response.Header().Set("Content-Type", "application/json") + response.WriteHeader(profileResp.StatusCode) _, err = io.Copy(response, profileResp.Body) if err != nil {