From 1d4940b90327585579e0d0cfc0cc0df63e445f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Wed, 14 Apr 2021 15:34:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96cors,=E6=9B=B4=E5=A5=BD?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81RESFULAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/cors.js | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/middleware/cors.js b/middleware/cors.js index 9637246..fb25d87 100644 --- a/middleware/cors.js +++ b/middleware/cors.js @@ -31,6 +31,7 @@ export default function(req, res, next) { } res.set('Access-Control-Allow-Origin', `${protocol}//${host}`) + res.set('Access-Control-Allow-Methods', 'GET,HEAD,POST,PUT,DELETE,PATCH') if (headers) { res.set('Access-Control-Allow-Headers', headers) diff --git a/package.json b/package.json index 00514e8..e5827ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gm5/core", - "version": "1.0.2", + "version": "1.0.3", "type": "module", "description": "Five.js, 一个轻量级的nodejs mvc框架 旨在简单易用, 5分钟即可上手", "author": "yutent ",