File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,15 @@ import { otlpExporter } from "~/v3/otlpExporter.server";
44
55export async function action ( { request } : ActionFunctionArgs ) {
66 try {
7- const contentType = request . headers . get ( "content-type" ) ;
7+ const contentType = request . headers . get ( "content-type" ) ?. toLowerCase ( ) ?? "" ;
88
9- if ( contentType === "application/json" ) {
9+ if ( contentType . startsWith ( "application/json" ) ) {
1010 const body = await request . json ( ) ;
1111
1212 const exportResponse = await otlpExporter . exportLogs ( body as ExportLogsServiceRequest ) ;
1313
1414 return json ( exportResponse , { status : 200 } ) ;
15- } else if ( contentType === "application/x-protobuf" ) {
15+ } else if ( contentType . startsWith ( "application/x-protobuf" ) ) {
1616 const buffer = await request . arrayBuffer ( ) ;
1717
1818 const exportRequest = ExportLogsServiceRequest . decode ( new Uint8Array ( buffer ) ) ;
Original file line number Diff line number Diff line change @@ -4,15 +4,15 @@ import { otlpExporter } from "~/v3/otlpExporter.server";
44
55export async function action ( { request } : ActionFunctionArgs ) {
66 try {
7- const contentType = request . headers . get ( "content-type" ) ;
7+ const contentType = request . headers . get ( "content-type" ) ?. toLowerCase ( ) ?? "" ;
88
9- if ( contentType === "application/json" ) {
9+ if ( contentType . startsWith ( "application/json" ) ) {
1010 const body = await request . json ( ) ;
1111
1212 const exportResponse = await otlpExporter . exportTraces ( body as ExportTraceServiceRequest ) ;
1313
1414 return json ( exportResponse , { status : 200 } ) ;
15- } else if ( contentType === "application/x-protobuf" ) {
15+ } else if ( contentType . startsWith ( "application/x-protobuf" ) ) {
1616 const buffer = await request . arrayBuffer ( ) ;
1717
1818 const exportRequest = ExportTraceServiceRequest . decode ( new Uint8Array ( buffer ) ) ;
You can’t perform that action at this time.
0 commit comments