From f9b3d11122aaca266bebd89bf5ffeeeabf9a2114 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 29 May 2022 17:05:13 +0200 Subject: [PATCH] Fixed bug headers HTTP --- protocols/hypertextTransferProtocolStrategy.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/protocols/hypertextTransferProtocolStrategy.go b/protocols/hypertextTransferProtocolStrategy.go index e81d105..4327176 100644 --- a/protocols/hypertextTransferProtocolStrategy.go +++ b/protocols/hypertextTransferProtocolStrategy.go @@ -96,14 +96,14 @@ func mapCookiesToString(cookies []*http.Cookie) string { } func setResponseHeaders(responseWriter http.ResponseWriter, headers []string, statusCode int) { - // http.StatusText(statusCode): empty string if the code is unknown. - if len(http.StatusText(statusCode)) > 0 { - responseWriter.WriteHeader(statusCode) - } for _, headerStr := range headers { keyValue := strings.Split(headerStr, ":") if len(keyValue) > 1 { responseWriter.Header().Add(keyValue[0], keyValue[1]) } } + // http.StatusText(statusCode): empty string if the code is unknown. + if len(http.StatusText(statusCode)) > 0 { + responseWriter.WriteHeader(statusCode) + } }