From 893a5550519fe610762bcf1a4de191341ccec775 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 16 Jul 2024 09:43:47 +0200 Subject: [PATCH] Revert "lib/protoparser/opentelemetry/firehose: escape requestID before returning it to user (#6451)" This reverts commit cd1aca217cf3b44bf4bc38ac71400ec6aa9bd579. Reason for revert: this commit has no sense, since the firehose response has application/json content-type, so it must contain JSON-encoded timestamp and requestId fields according to https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html#responseformat . HTML-escaping the requestId field may break the response, so the client couldn't correctly recognize the html-escaped requestId. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/6451 --- lib/protoparser/opentelemetry/firehose/http.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/protoparser/opentelemetry/firehose/http.go b/lib/protoparser/opentelemetry/firehose/http.go index d17b14a0d..a222e7279 100644 --- a/lib/protoparser/opentelemetry/firehose/http.go +++ b/lib/protoparser/opentelemetry/firehose/http.go @@ -2,7 +2,6 @@ package firehose import ( "fmt" - "html" "net/http" "time" ) @@ -13,12 +12,11 @@ import ( func WriteSuccessResponse(w http.ResponseWriter, r *http.Request) { requestID := r.Header.Get("X-Amz-Firehose-Request-Id") if requestID == "" { - // This isn't an AWS firehose request - just return an empty response in this case. + // This isn't a AWS firehose request - just return an empty response in this case. w.WriteHeader(http.StatusOK) return } - requestID = html.EscapeString(requestID) body := fmt.Sprintf(`{"requestId":%q,"timestamp":%d}`, requestID, time.Now().UnixMilli()) h := w.Header()