hello,
a GET request has no body, yet the HTTP RFC allows to set content-type on GET requests
(https://tools.ietf.org/html/rfc7231#section-3.1.1.5)
in this case it simply does not apply.
We see this commonly with customers that switch requests between GET and POST, but leaving the content-type header specified. For GET requests, it should simply have no effect.
However, the binding middleware will, upon detection of a non-zero content-type header, switch to trying to use the json decoder on the body, even when there is no body such as in a GET request.
This results in errors such as https://github.com/grafana/metrictank/issues/1465 :
hello, a GET request has no body, yet the HTTP RFC allows to set content-type on GET requests (https://tools.ietf.org/html/rfc7231#section-3.1.1.5) in this case it simply does not apply. We see this commonly with customers that switch requests between GET and POST, but leaving the content-type header specified. For GET requests, it should simply have no effect.
However, the binding middleware will, upon detection of a non-zero content-type header, switch to trying to use the json decoder on the body, even when there is no body such as in a GET request. This results in errors such as https://github.com/grafana/metrictank/issues/1465 :
the correct behavior would be to process the request based on its method (e.g. GET requests use GET parameters)