whistle.mock-plugins 1.0.6-beta.2 → 1.0.6-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ruleManager.js +1 -4
- package/package.json +1 -1
package/lib/ruleManager.js
CHANGED
|
@@ -232,11 +232,8 @@ const ruleManager = {
|
|
|
232
232
|
this.log(`[规则处理器] 处理请求,接口: ${interfaceObj.name}, 代理类型: ${proxyType}`);
|
|
233
233
|
|
|
234
234
|
// 添加CORS支持 - 设置跨域相关的响应头
|
|
235
|
-
res.setHeader('Access-Control-Allow-Origin',
|
|
236
|
-
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS, PATCH');
|
|
237
|
-
res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With, Accept');
|
|
235
|
+
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
238
236
|
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
|
239
|
-
res.setHeader('Access-Control-Max-Age', '86400'); // 24小时
|
|
240
237
|
|
|
241
238
|
// 处理预检请求
|
|
242
239
|
if (req.method === 'OPTIONS') {
|