Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Check whether the value is legal Before setting the header #72

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

GuanyuChen
Copy link

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

add utils.checkInvalidHeaderChar, check whether the value is legal Before setting the header, the illegal header will not be set

@GuanyuChen GuanyuChen marked this pull request as draft December 6, 2021 06:54
@GuanyuChen GuanyuChen marked this pull request as ready for review December 6, 2021 06:54
@GuanyuChen
Copy link
Author

@dead-horse 大佬有时间帮忙 review 一下不?

@@ -62,7 +62,12 @@ module.exports = options => {
}
}
const headerString = bufArray.join(';');
ctx.set(finalHeader, headerString);
ctx.set('x-csp-nonce', ctx.nonce);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该在设置 nonce 的时候做参数校验逻辑,而不是在响应返回的时候,这个时机太晚了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants