Socket
Socket
Sign inDemoInstall

@aomex/cors

Package Overview
Dependencies
Maintainers
0
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aomex/cors - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

22

CHANGELOG.md

@@ -1,21 +0,11 @@

# @aomex/cors
# Change Log
## 1.0.4
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 1.0.3
# 1.1.0 (2024-06-27)
## 1.0.2
## 1.0.1
### Features
## 1.0.0
### Minor Changes
- [`11103a2`](https://github.com/aomex/aomex/commit/11103a2aff4e081754c56b0ff18fa5130ca252e8) Thanks [@geekact](https://github.com/geekact)! - 重新制作
### Patch Changes
- Updated dependencies [[`11103a2`](https://github.com/aomex/aomex/commit/11103a2aff4e081754c56b0ff18fa5130ca252e8)]:
- @aomex/core@1.0.0
- @aomex/web@1.0.0
* 初始化 ([3350159](https://github.com/aomex/aomex/commit/3350159454ad230e6d910405f907293b059b1f49))

@@ -5,7 +5,7 @@ import { WebContext, WebMiddleware } from '@aomex/web';

/**
* 设置报头Access-Control-Allow-Origin,表示该响应的资源是否被允许与给定的来源(origin)共享。对于不包含凭据的请求,也可以设为星号(\*),表示同意任意跨源请求
* 设置报头 Access-Control-Allow-Origin,表示该响应的资源是否被允许与给定的来源(origin)共享。对于不包含凭据的请求,也可以设为星号(\*),表示同意任意跨源请求
*/
origin?: ((ctx: WebContext) => string | undefined | Promise<string | undefined>) | string;
/**
* 设置报头Access-Control-Allow-Methods,表示客户端所要访问的资源允许使用的方法或方法列表。
* 设置报头 Access-Control-Allow-Methods,表示客户端所要访问的资源允许使用的方法或方法列表。
* 默认值:`GET,HEAD,PUT,POST,DELETE,PATCH`

@@ -25,3 +25,3 @@ */

*
*
* 也支持自定义:
* ```typescript

@@ -37,7 +37,7 @@ * cors({

/**
* `Access-Control-Allow-Headers`
* 设置报头 Access-Control-Allow-Headers
*/
allowHeaders?: string[] | string;
/**
* 设置报头Access-Control-Max-Age,表示 Access-Control-Allow-Methods 和 Access-Control-Allow-Headers 提供的信息可以被缓存的最长时间(秒)
* 设置报头 Access-Control-Max-Age,表示 Access-Control-Allow-Methods 和 Access-Control-Allow-Headers 提供的信息可以被缓存的最长时间(秒)
*

@@ -48,7 +48,7 @@ * 如果值为`-1`,表示禁用缓存,则每次请求前都需要使用 OPTIONS 预检请求

/**
* 设置报头Access-Control-Allow-Credentials,Credentials可以代表 cookies、authorization headers 或 TLS client certificates,需要与客户端 XMLHttpRequest.withCredentials 或 Fetch API 的 credentials 选项结合使用
* 设置报头 Access-Control-Allow-Credentials,Credentials可以代表 cookies、authorization headers 或 TLS client certificates,需要与客户端 XMLHttpRequest.withCredentials 或 Fetch API 的 credentials 选项结合使用
*/
credentials?: ((ctx: WebContext) => boolean | Promise<boolean>) | boolean;
/**
* 响应头部增加 `Cross-Origin-Opener-Policy` 和 `Cross-Origin-Embedder-Policy` 这两个个报头。默认值:`false`
* 响应头部增加 Cross-Origin-Opener-Policy 和 Cross-Origin-Embedder-Policy 这两个个报头。默认值:`false`
*

@@ -59,3 +59,3 @@ * @see https://developer.mozilla.org/en_US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/Planned_changes

/**
* 处理请求报头 `Access-Control-Request-Private-Network` 并返回报头`Access-Control-Allow-Private-Network`。默认值:`false`
* 处理请求报头 Access-Control-Request-Private-Network 并返回报头 Access-Control-Allow-Private-Network。默认值:`false`
*

@@ -62,0 +62,0 @@ * @link https://github.com/WICG/private-network-access

{
"name": "@aomex/cors",
"version": "1.0.4",
"version": "1.1.0",
"description": "跨站资源共享",

@@ -34,4 +34,4 @@ "repository": "git@github.com:aomex/aomex.git",

"@types/vary": "^1.1.3",
"@aomex/core": "^1.0.4",
"@aomex/web": "^1.0.4"
"@aomex/core": "^1.1.0",
"@aomex/web": "^1.1.0"
},

@@ -38,0 +38,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

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