Updates the error handling logic to check if the error is from an invalid content type first. This is necessary to ensure we can successfully create a valid OTLP response. This needs to be first because it determines how we present any errors back (eg invalid API ket).
This PR also updates WriteOtlpHttpFailureResponse to check if the error is an invalid content type, and write a text/pain response if true. This removes the need for consumers of this function to have to do it themselves.
Short description of the changes
Update each signal's validate headers function to check content type first
Update WriteOtlpHttpResponse to check if the content type is valid, if not writes a HTTP status code 415 text/plain error response instead
Which problem is this PR solving?
Updates the error handling logic to check if the error is from an invalid content type first. This is necessary to ensure we can successfully create a valid OTLP response. This needs to be first because it determines how we present any errors back (eg invalid API ket).
This PR also updates WriteOtlpHttpFailureResponse to check if the error is an invalid content type, and write a text/pain response if true. This removes the need for consumers of this function to have to do it themselves.
Short description of the changes
WriteOtlpHttpResponse
to check if the content type is valid, if not writes a HTTP status code 415 text/plain error response instead