Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@octokit/webhooks

Package Overview
Dependencies
Maintainers
1
Versions
286
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/webhooks - npm Package Compare versions

Comparing version
14.1.1
to
14.1.2
+18
dist-src/normalize-trailing-slashes.js
function normalizeTrailingSlashes(path) {
let i = path.length;
if (i === 0) {
return "/";
}
while (i > 0) {
if (path.charCodeAt(--i) !== 47) {
break;
}
}
if (i === -1) {
return "/";
}
return path.slice(0, i + 1);
}
export {
normalizeTrailingSlashes
};
export declare function normalizeTrailingSlashes(path: string): string;
+23
-2

@@ -546,2 +546,19 @@ // pkg/dist-src/create-logger.js

// pkg/dist-src/normalize-trailing-slashes.js
function normalizeTrailingSlashes(path) {
let i = path.length;
if (i === 0) {
return "/";
}
while (i > 0) {
if (path.charCodeAt(--i) !== 47) {
break;
}
}
if (i === -1) {
return "/";
}
return path.slice(0, i + 1);
}
// pkg/dist-src/middleware/create-middleware.js

@@ -557,6 +574,10 @@ var isApplicationJsonRE = /^\s*(application\/json)\s*(?:;|$)/u;

return function middleware(webhooks, options2) {
const middlewarePath = normalizeTrailingSlashes(options2.path);
return async function octokitWebhooksMiddleware(request, response, next) {
let pathname;
try {
pathname = new URL(request.url, "http://localhost").pathname;
pathname = new URL(
normalizeTrailingSlashes(request.url),
"http://localhost"
).pathname;
} catch (error) {

@@ -574,3 +595,3 @@ return handleResponse3(

}
if (pathname !== options2.path) {
if (pathname !== middlewarePath) {
next?.();

@@ -577,0 +598,0 @@ return handleResponse3(null);

+7
-2

@@ -0,1 +1,2 @@

import { normalizeTrailingSlashes } from "../normalize-trailing-slashes.js";
const isApplicationJsonRE = /^\s*(application\/json)\s*(?:;|$)/u;

@@ -10,6 +11,10 @@ const WEBHOOK_HEADERS = [

return function middleware(webhooks, options2) {
const middlewarePath = normalizeTrailingSlashes(options2.path);
return async function octokitWebhooksMiddleware(request, response, next) {
let pathname;
try {
pathname = new URL(request.url, "http://localhost").pathname;
pathname = new URL(
normalizeTrailingSlashes(request.url),
"http://localhost"
).pathname;
} catch (error) {

@@ -27,3 +32,3 @@ return handleResponse(

}
if (pathname !== options2.path) {
if (pathname !== middlewarePath) {
next?.();

@@ -30,0 +35,0 @@ return handleResponse(null);

{
"name": "@octokit/webhooks",
"version": "14.1.1",
"version": "14.1.2",
"description": "GitHub webhook events toolset for Node.js",

@@ -24,3 +24,3 @@ "keywords": [],

"get-port": "^7.1.0",
"prettier": "3.5.3",
"prettier": "3.6.2",
"prettier-plugin-packagejson": "^2.2.9",

@@ -27,0 +27,0 @@ "tsx": "^4.19.3",

Sorry, the diff of this file is not supported yet