Don't write an HTTP response 204 to logs (#7035)
Vladimir Kobal committed
Oct 16, 2019 at 12:45 UTC
05fd62ba5b8ed628310627311e284932cc96fa5f
1 file changed
+2
-2
backends/prometheus/backend_prometheus.c
+2
-2
@@ -780,7 +780,7 @@ int process_prometheus_remote_write_response(BUFFER *b) {
780
const char *s = buffer_tostring(b);
781
int len = buffer_strlen(b);
782
783
- // do nothing with HTTP response 200
783
+ // do nothing with HTTP responses 200 or 204
784
785
while(!isspace(*s) && len) {
786
s++;
@@ -789,7 +789,7 @@ int process_prometheus_remote_write_response(BUFFER *b) {
789
s++;
790
len--;
791
792
- if(likely(len > 4 && !strncmp(s, "200 ", 4)))
792
+ if(likely(len > 4 && (!strncmp(s, "200 ", 4) || !strncmp(s, "204 ", 4))))
793
return 0;
794
else
795
return discard_response(b, "prometheus remote write");