Skip to content

Commit d984176

Browse files
committed
feat(remix): Skip span creation for OPTIONS and HEAD requests.
1 parent fa1621c commit d984176

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/remix/src/utils/instrumentServer.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,13 @@ function wrapRequestHandler(origRequestHandler: RequestHandler, build: ServerBui
430430
return origRequestHandler.call(this, request, loadContext);
431431
}
432432

433+
const upperCaseMethod = request.method.toUpperCase();
434+
435+
// We don't want to wrap OPTIONS and HEAD requests
436+
if (upperCaseMethod === 'OPTIONS' || upperCaseMethod === 'HEAD') {
437+
return origRequestHandler.call(this, request, loadContext);
438+
}
439+
433440
return withIsolationScope(async isolationScope => {
434441
const options = getClient()?.getOptions();
435442

0 commit comments

Comments
 (0)