Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@compas/server

Package Overview
Dependencies
Maintainers
0
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compas/server - npm Package Compare versions

Comparing version 0.12.0 to 0.12.1

4

package.json
{
"name": "@compas/server",
"version": "0.12.0",
"version": "0.12.1",
"description": "Koa server and common middleware",

@@ -24,3 +24,3 @@ "exports": {

"dependencies": {
"@compas/stdlib": "0.12.0",
"@compas/stdlib": "0.12.1",
"@types/formidable": "2.0.6",

@@ -27,0 +27,0 @@ "@types/koa": "2.15.0",

@@ -82,3 +82,7 @@ import { Transform } from "node:stream";

// Skip eventStop for CORS requests, this gives a bit cleaner logs.
if (options.disableRootEvent !== true && ctx.method !== "OPTIONS") {
if (
options.disableRootEvent !== true &&
ctx.method !== "OPTIONS" &&
ctx.method !== "HEAD"
) {
if (_compasSentryExport) {

@@ -95,8 +99,8 @@ const span = _compasSentryExport.getActiveSpan();

if (_compasSentryExport) {
const span = _compasSentryExport.getActiveSpan();
const routeName = ctx.event.name;
const isMatchedRoute = routeName.startsWith("router.");
if (_compasSentryExport.metrics?.increment) {
let compasRouteName = ctx.event.name;
if (!compasRouteName.startsWith("router.")) {
compasRouteName = "<unmatched>";
}
const compasRouteName = isMatchedRoute ? routeName : "<unmatched>";
_compasSentryExport.metrics.increment("compas.route.name", 1, {

@@ -110,4 +114,10 @@ tags: {

const span = _compasSentryExport.getActiveSpan();
if (span) {
if (!isMatchedRoute) {
// @ts-expect-error Private property?
//
// Discard sampled spans which don't match a route.
span._sampled = false;
}
span.setStatus(

@@ -114,0 +124,0 @@ _compasSentryExport.getSpanStatusFromHttpCode(ctx.status),

@@ -36,3 +36,3 @@ import { _compasSentryExport } from "@compas/stdlib";

return _sentry.withIsolationScope(() => {
return _sentry.startNewTrace(() => {
return _sentry.startSpanManual(

@@ -39,0 +39,0 @@ {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc