From efe2c384d85900fa08bc9c0cee9c224724f6d894 Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 4 Jul 2022 19:08:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0url=E5=85=83=E5=AD=97?= =?UTF-8?q?=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 2 +- package.json | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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"