@elysiajs/cors
Advanced tools
Comparing version 1.1.0-rc.0 to 1.1.0-rc.1
@@ -121,15 +121,14 @@ "use strict"; | ||
app.headers(defaultHeaders); | ||
function handleOption({ set, request }) { | ||
function handleOption({ set, request, headers }) { | ||
handleOrigin(set, request); | ||
handleMethod(set, request.headers.get("access-control-request-method")); | ||
if (allowedHeaders === true || exposeHeaders === true) { | ||
const headers = processHeaders(request.headers); | ||
if (allowedHeaders === true) | ||
set.headers["access-control-allow-headers"] = headers; | ||
set.headers["access-control-allow-headers"] = headers["access-control-request-headers"]; | ||
if (exposeHeaders === true) | ||
set.headers["access-control-expose-headers"] = headers; | ||
set.headers["access-control-expose-headers"] = Object.keys(headers).join(","); | ||
} | ||
if (maxAge) set.headers["access-control-max-age"] = maxAge.toString(); | ||
return new Response(null, { | ||
status: 200 | ||
status: 204 | ||
}); | ||
@@ -136,0 +135,0 @@ } |
{ | ||
"name": "@elysiajs/cors", | ||
"version": "1.1.0-rc.0", | ||
"description": "Plugin for Elysia that for Cross Origin Requests (CORs)", | ||
"author": { | ||
"name": "saltyAom", | ||
"url": "https://github.com/SaltyAom", | ||
"email": "saltyaom@gmail.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/elysiajs/elysia-cors" | ||
}, | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/cjs/index.js" | ||
} | ||
}, | ||
"homepage": "https://github.com/elysiajs/elysia-cors", | ||
"keywords": [ | ||
"elysia", | ||
"cors" | ||
], | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "bun run --watch example/index.ts", | ||
"test": "bun test && npm run test:node", | ||
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js", | ||
"build": "bun build.ts", | ||
"release": "npm run build && npm run test && npm publish --access public" | ||
}, | ||
"devDependencies": { | ||
"@types/bun": "1.1.6", | ||
"elysia": ">= 1.1.0-rc.2", | ||
"eslint": "9.6.0", | ||
"tsup": "^8.1.0", | ||
"typescript": "^5.5.3" | ||
}, | ||
"peerDependencies": { | ||
"elysia": ">= 1.1.0-rc.2" | ||
} | ||
} | ||
"name": "@elysiajs/cors", | ||
"version": "1.1.0-rc.1", | ||
"description": "Plugin for Elysia that for Cross Origin Requests (CORs)", | ||
"author": { | ||
"name": "saltyAom", | ||
"url": "https://github.com/SaltyAom", | ||
"email": "saltyaom@gmail.com" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/elysiajs/elysia-cors" | ||
}, | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs", | ||
"require": "./dist/cjs/index.js" | ||
} | ||
}, | ||
"homepage": "https://github.com/elysiajs/elysia-cors", | ||
"keywords": [ | ||
"elysia", | ||
"cors" | ||
], | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "bun run --watch example/index.ts", | ||
"test": "bun test && npm run test:node", | ||
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js", | ||
"build": "bun build.ts", | ||
"release": "npm run build && npm run test && npm publish --access public" | ||
}, | ||
"devDependencies": { | ||
"@types/bun": "^1.1.6", | ||
"@types/node": "^20.14.10", | ||
"elysia": "1.1.0-rc.6", | ||
"eslint": "^8.26.0", | ||
"typescript": "^5.5.2" | ||
}, | ||
"peerDependencies": { | ||
"elysia": ">= 1.1.0-rc.6" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
25269
10
0
556