fix(enshan): avoid WAF 521 by not forcing Accept/UA#572
Open
desicend wants to merge 2 commits intoSitoi:mainfrom
Open
fix(enshan): avoid WAF 521 by not forcing Accept/UA#572desicend wants to merge 2 commits intoSitoi:mainfrom
desicend wants to merge 2 commits intoSitoi:mainfrom
Conversation
Author
|
补充说明:这个 PR 的目标是规避 right.com.cn 的 WAF 误判(521),所以尽量避免在 Session 级别固定 UA/Accept 之类的“特征化”请求头。 这次我也把 POST 的 headers 收敛到最小集(只保留 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
right.com.cn 近期有 WAF 行为;实测在某些 User-Agent/Accept 组合下会返回 521(即使 cookie 正确)。
变更
Accept: text/html,...,用于拉取签到页并解析formhash/ 个人积分页。X-Requested-With: XMLHttpRequest,其余交给 requests 默认行为。影响范围
仅影响 enshan(恩山无线论坛)模块的请求头策略;不引入新依赖,不改变业务流程。
风险