node-tool-utils
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -0,1 +1,10 @@ | ||
## [1.4.1](https://github.com/hubcarl/node-tool-utils/compare/1.4.0...1.4.1) (2019-10-22) | ||
### Bug Fixes | ||
* cors not get request, will trigger options request and valid custom header ([25bb949](https://github.com/hubcarl/node-tool-utils/commit/25bb949)) | ||
# [1.4.0](https://github.com/hubcarl/node-tool-utils/compare/1.3.0...1.4.0) (2019-10-21) | ||
@@ -2,0 +11,0 @@ |
@@ -76,2 +76,12 @@ 'use strict'; | ||
response.setHeader('Access-Control-Allow-Origin', '*'); | ||
response.setHeader("Access-Control-Allow-Credentials", "true"); | ||
response.setHeader("Access-Control-Allow-Methods", "*"); | ||
response.setHeader("Access-Control-Expose-Headers", "*"); | ||
// 跨域导致的自定义Header问题 | ||
response.setHeader("Access-Control-Allow-Headers", "*"); | ||
// 跨域非 GET 请求会触发 OPTIONS 请求 | ||
if (request.method === 'OPTIONS') { | ||
response.statusCode = 200; | ||
return; | ||
} | ||
@@ -78,0 +88,0 @@ // image |
{ | ||
"name": "node-tool-utils", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "node cross-platform tool library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
17423
335