eggjs / egg-security

Security plugin for egg, force performance too.
MIT License
238 stars 43 forks source link

feat: context 中的 `isSafeDomain()` 函数增加自定义白名单参数 #86

Closed yisibl closed 1 year ago

yisibl commented 1 year ago

此前,isSafeDomain() 只有一个参数,无法自定义白名单。

为了在 egg-cors 或其他插件中可以复用该函数的逻辑,现在增加第二个参数, 使其更加灵活。

Checklist
Affected core subsystem(s)
Description of change
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (c3ca817) 97.22% compared to head (4ec88ca) 97.22%. Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #86 +/- ## ======================================= Coverage 97.22% 97.22% ======================================= Files 32 32 Lines 1331 1334 +3 Branches 336 334 -2 ======================================= + Hits 1294 1297 +3 Misses 37 37 ``` | [Files Changed](https://app.codecov.io/gh/eggjs/egg-security/pull/86?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eggjs) | Coverage Δ | | |---|---|---| | [app/extend/context.js](https://app.codecov.io/gh/eggjs/egg-security/pull/86?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eggjs#diff-YXBwL2V4dGVuZC9jb250ZXh0Lmpz) | `99.13% <100.00%> (+0.01%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 3.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: