diff --git a/index.js b/index.js index c2aa9f0..304c1fe 100644 --- a/index.js +++ b/index.js @@ -60,7 +60,7 @@ export default class Request { _url = decode(_url) // URL上不允许有非法字符 - if (/[^\w\-\/\.]/.test(_url)) { + if (/[^\w-/.@~!$&:+'=]/.test(_url)) { this.origin.res.rendered = true this.origin.res.writeHead(400, { 'X-debug': `url [/${encode(_url)}] contains invalid characters` diff --git a/package.json b/package.json index 2f2b6ea..f23546b 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,18 @@ { "name": "@gm5/request", - "version": "1.2.6", + "version": "1.2.7", "description": "对Http的request进一步封装, 提供常用的API", "main": "index.js", "author": "yutent", "type": "module", - "keywords": ["five", "node-five", "five.js", "fivejs", "request", "http"], + "keywords": [ + "five", + "node-five", + "five.js", + "fivejs", + "request", + "http" + ], "dependencies": { "es.shim": "^2.0.1", "iofs": "^1.5.0"