New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tinyhttp/cors

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/cors - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

dist/index.cjs

9

dist/index.js

@@ -7,4 +7,5 @@ import { vary } from 'es-vary';

const cors = (opts = {}) => {
const { origin = '*', methods = ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'], allowedHeaders, exposedHeaders, credentials, maxAge, optionsSuccessStatus = 204, preflightContinue = false } = opts;
const { origin = '*', methods = ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE'], allowedHeaders = ['content-type'], exposedHeaders, credentials, maxAge, optionsSuccessStatus = 204, preflightContinue = false } = opts;
return (req, res, next) => {
var _a, _b;
// Checking the type of the origin property

@@ -47,5 +48,5 @@ if (typeof origin === 'boolean' && origin === true) {

res.setHeader('Access-Control-Max-Age', maxAge);
if (req.method?.toUpperCase?.() === 'OPTIONS') {
if (((_b = (_a = req.method) === null || _a === void 0 ? void 0 : _a.toUpperCase) === null || _b === void 0 ? void 0 : _b.call(_a)) === 'OPTIONS') {
if (preflightContinue) {
next?.();
next === null || next === void 0 ? void 0 : next();
}

@@ -59,3 +60,3 @@ else {

else {
next?.();
next === null || next === void 0 ? void 0 : next();
}

@@ -62,0 +63,0 @@ };

{
"name": "@tinyhttp/cors",
"version": "1.3.1",
"version": "1.3.2",
"description": "tinyhttp CORS module",

@@ -5,0 +5,0 @@ "type": "module",

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