@@ -4,7 +4,6 @@ package quesma
44
55import (
66 "net/http"
7- "quesma/logger"
87 "slices"
98)
109
@@ -36,18 +35,18 @@ func addProductAndContentHeaders(request http.Header, response http.Header) {
3635 response .Set (contentTypeHeaderKey , "application/json; charset=UTF-8" )
3736 } else {
3837 response .Set (elasticSearchResponseHeaderKey , elasticSearchResponseHeaderValue )
39- response .Set (contentTypeHeaderKey , "application/vnd.elasticsearch+json;compatible-with=8" )
38+ // response.Set(contentTypeHeaderKey, "application/vnd.elasticsearch+json;compatible-with=8")
4039 }
40+ // WARNING:
41+ // Elasticsearch 8.x responds with `Content-Type: application/vnd.elasticsearch+json;compatible-with=8`
42+ // Elasticsearch 7.x responds with `Content-Type: application/json; charset=UTF-8`
43+ // We decided to always use the 7.x response for now, but we might need to change it in the future.
44+ // Specifically, we might need to change this behaviour by introducing Elasticsearch 8 and Elasticsearch 7-specific frontend connectors.
45+ // More in: https://github.com/QuesmaOrg/quesma/issues/994
46+ response .Set (contentTypeHeaderKey , "application/json; charset=UTF-8" )
4147 response .Set (opaqueIdHeaderKey , "unknownId" )
4248}
4349
44- func LogMissingEsHeaders (elasticsearchHeaders , quesmaHeaders http.Header , reqId string ) {
45- missingHeaders := findMissingElasticsearchHeaders (elasticsearchHeaders , quesmaHeaders )
46- for _ , headerName := range missingHeaders {
47- logger .Warn ().Str (logger .RID , reqId ).Msgf ("Header %s is missing in Quesma's response" , headerName )
48- }
49- }
50-
5150func findMissingElasticsearchHeaders (elasticsearchHeaders , quesmaHeaders http.Header ) []string {
5251 var missingHeaders []string
5352 for esHeaderName := range elasticsearchHeaders {
0 commit comments