Skip to content

Commit 418fa82

Browse files
committed
Not checking if search params is standard on whitelist mode
1 parent ca31e6f commit 418fa82

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ This table shows supported parameters for each mode:
218218

219219
| Param\Mode | `white` | `black` | `param` | `regex` | `redirect` | `visit` | `lambda` |
220220
| ---------- | -- | --- | -- | --- | -- | --- | -- |
221-
| `std` | |||||||
221+
| `std` | |||||||
222222
| `params` ||||||||
223223
| `acts` ||||||||
224224
| `regex` ||||||||
@@ -233,9 +233,8 @@ This table shows supported parameters for each mode:
233233
| Param | Type | Default |
234234
| --- | --- | --- |
235235
| `params` | `string[]` | Required |
236-
| `std` | `Boolean` | `false` |
237236

238-
Under Whitelist mode, only the parameters specified in `params` will be kept, and others will be removed. `std` is for controlling whether the URL search string shall be deemed standard. Only if it is `true` or the URL search string is indeed standard will the URL be processed. Usually this is the most commonly used mode.
237+
Under Whitelist mode, only the parameters specified in `params` will be kept, and others will be removed. Usually this is the most commonly used mode.
239238

240239
#### 🔴 Blacklist Mode `black`
241240

README_zh.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ new Purlfy({
219219

220220
| 参数\模式 | `white` | `black` | `param` | `regex` | `redirect` | `visit` | `lambda` |
221221
| ---------- | -- | --- | -- | --- | -- | --- | -- |
222-
| `std` | |||||||
222+
| `std` | |||||||
223223
| `params` ||||||||
224224
| `acts` ||||||||
225225
| `regex` ||||||||
@@ -234,9 +234,8 @@ new Purlfy({
234234
| 参数 | 类型 | 默认值 |
235235
| --- | --- | --- |
236236
| `params` | `string[]` | 必须 |
237-
| `std` | `Boolean` | `false` |
238237

239-
白名单模式下,只有在 `params` 中指定的查询参数才会被保留,原网址中的其余查询参数会被删除。`std` 控制是否假定 URL 的查询参数是符合标准的,只有它被设为为 `true` 或 URL 的查询参数确实符合标准时才会按规则处理此网址。通常来说这是最常用的模式。
238+
白名单模式下,只有在 `params` 中指定的查询参数才会被保留,原网址中的其余查询参数会被删除。通常来说这是最常用的模式。
240239

241240
#### 🔴 黑名单模式 `black`
242241

purlfy.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@ class Purlfy extends EventTarget {
188188
let shallContinue = false;
189189
switch (mode) { // Purifies `urlObj` based on the rule
190190
case "white": { // Whitelist mode
191-
if (!rule.std && !Purlfy.#isStandard(urlObj)) {
192-
logFunc("Non-standard URL search string:", urlObj.search);
193-
break;
194-
}
195191
const newParams = new URLSearchParams();
196192
for (const param of rule.params) {
197193
if (urlObj.searchParams.has(param)) {

0 commit comments

Comments
 (0)