🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

hono

Package Overview
Dependencies
Maintainers
1
Versions
439
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hono - npm Package Compare versions

Comparing version
4.12.31
to
4.12.32
+1
-1
dist/cjs/helper/streaming/sse.js

@@ -45,3 +45,3 @@ var __defProp = Object.defineProperty;

dataLines,
message.id && `id: ${message.id}`,
message.id !== void 0 && `id: ${message.id}`,
message.retry !== void 0 && `retry: ${message.retry}`

@@ -48,0 +48,0 @@ ].filter(Boolean).join("\n") + "\n\n";

@@ -74,3 +74,6 @@ var __defProp = Object.defineProperty;

if (options.contentSecurityPolicy) {
const [callback, value] = getCSPDirectives(options.contentSecurityPolicy);
const [callback, value] = getCSPDirectives(
options.contentSecurityPolicy,
"Content-Security-Policy"
);
if (callback) {

@@ -82,3 +85,6 @@ callbacks.push(callback);

if (options.contentSecurityPolicyReportOnly) {
const [callback, value] = getCSPDirectives(options.contentSecurityPolicyReportOnly);
const [callback, value] = getCSPDirectives(
options.contentSecurityPolicyReportOnly,
"Content-Security-Policy-Report-Only"
);
if (callback) {

@@ -116,3 +122,3 @@ callbacks.push(callback);

}
function getCSPDirectives(contentSecurityPolicy) {
function getCSPDirectives(contentSecurityPolicy, headerName) {
const callbacks = [];

@@ -142,3 +148,3 @@ const resultValues = [];

(ctx, headersToSet) => headersToSet.map((values) => {
if (values[0] === "Content-Security-Policy" || values[0] === "Content-Security-Policy-Report-Only") {
if (values[0] === headerName) {
const clone = values[1].slice();

@@ -145,0 +151,0 @@ callbacks.forEach((cb) => {

@@ -101,3 +101,3 @@ var __defProp = Object.defineProperty;

}
const headerData = {};
const headerData = /* @__PURE__ */ Object.create(null);
this.raw.headers.forEach((value, key) => {

@@ -104,0 +104,0 @@ headerData[key] = value;

@@ -149,3 +149,3 @@ var __defProp = Object.defineProperty;

type: "",
params: {},
params: /* @__PURE__ */ Object.create(null),
q: 1

@@ -152,0 +152,0 @@ };

@@ -195,3 +195,3 @@ var __defProp = Object.defineProperty;

}
const results = {};
const results = /* @__PURE__ */ Object.create(null);
encoded ??= /[%+]/.test(url);

@@ -198,0 +198,0 @@ let keyIndex = url.indexOf("?", 8);

@@ -23,3 +23,3 @@ // src/helper/streaming/sse.ts

dataLines,
message.id && `id: ${message.id}`,
message.id !== void 0 && `id: ${message.id}`,
message.retry !== void 0 && `retry: ${message.retry}`

@@ -26,0 +26,0 @@ ].filter(Boolean).join("\n") + "\n\n";

@@ -52,3 +52,6 @@ // src/middleware/secure-headers/secure-headers.ts

if (options.contentSecurityPolicy) {
const [callback, value] = getCSPDirectives(options.contentSecurityPolicy);
const [callback, value] = getCSPDirectives(
options.contentSecurityPolicy,
"Content-Security-Policy"
);
if (callback) {

@@ -60,3 +63,6 @@ callbacks.push(callback);

if (options.contentSecurityPolicyReportOnly) {
const [callback, value] = getCSPDirectives(options.contentSecurityPolicyReportOnly);
const [callback, value] = getCSPDirectives(
options.contentSecurityPolicyReportOnly,
"Content-Security-Policy-Report-Only"
);
if (callback) {

@@ -94,3 +100,3 @@ callbacks.push(callback);

}
function getCSPDirectives(contentSecurityPolicy) {
function getCSPDirectives(contentSecurityPolicy, headerName) {
const callbacks = [];

@@ -120,3 +126,3 @@ const resultValues = [];

(ctx, headersToSet) => headersToSet.map((values) => {
if (values[0] === "Content-Security-Policy" || values[0] === "Content-Security-Policy-Report-Only") {
if (values[0] === headerName) {
const clone = values[1].slice();

@@ -123,0 +129,0 @@ callbacks.forEach((cb) => {

@@ -79,3 +79,3 @@ // src/request.ts

}
const headerData = {};
const headerData = /* @__PURE__ */ Object.create(null);
this.raw.headers.forEach((value, key) => {

@@ -82,0 +82,0 @@ headerData[key] = value;

@@ -99,2 +99,11 @@ export interface CognitoIdentity {

};
jwt?: {
claims: Record<string, string | number | boolean | string[]>;
scopes: string[] | null;
};
/**
* The `context` object returned by a Lambda (REQUEST) authorizer.
* It is `null` when the authorizer returns no context.
*/
lambda?: Record<string, unknown> | null;
}

@@ -101,0 +110,0 @@ export interface ApiGatewayRequestContextV2 {

@@ -128,3 +128,3 @@ // src/utils/accept.ts

type: "",
params: {},
params: /* @__PURE__ */ Object.create(null),
q: 1

@@ -131,0 +131,0 @@ };

@@ -162,3 +162,3 @@ // src/utils/url.ts

}
const results = {};
const results = /* @__PURE__ */ Object.create(null);
encoded ??= /[%+]/.test(url);

@@ -165,0 +165,0 @@ let keyIndex = url.indexOf("?", 8);

{
"name": "hono",
"version": "4.12.31",
"version": "4.12.32",
"description": "Web framework built on Web Standards",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js",