Skip to content

Commit

Permalink
fix: add null content-type header check to traces and metrics endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Birkett <109664963+portswigger-tim@users.noreply.github.com>
  • Loading branch information
portswigger-tim authored and edsiper committed Jun 24, 2024
1 parent 4df367d commit 5b81ad7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugins/in_opentelemetry/opentelemetry_prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -2175,6 +2175,12 @@ static int process_payload_metrics_ng(struct flb_opentelemetry *ctx,

offset = 0;

if (request->content_type == NULL) {
flb_error("[otel] content type missing");

return -1;
}

if (strcasecmp(request->content_type, "application/grpc") == 0) {
if (cfl_sds_len(request->body) < 5) {
return -1;
Expand Down Expand Up @@ -2221,6 +2227,12 @@ static int process_payload_traces_proto_ng(struct flb_opentelemetry *ctx,

offset = 0;

if (request->content_type == NULL) {
flb_error("[otel] content type missing");

return -1;
}

if (strcasecmp(request->content_type, "application/grpc") == 0) {
if (cfl_sds_len(request->body) < 5) {
return -1;
Expand Down

0 comments on commit 5b81ad7

Please sign in to comment.