改进 URL 安全检查的私有网络拦截错误提示#100
Open
Ebola-Chan-bot wants to merge 1 commit into
Open
Conversation
assertPublicHttpUrl 和 assertPublicHttpUrlResolved 报错时: - 动态显示被拦截的实际 hostname 或 DNS 解析到的私有 IP - 当存在具体 IP 时,提示通过 FAKE_IP_CIDRS 环境变量放行 - 示例 CIDR 使用 ipaddr.parseCIDR 计算规范网络地址格式 - 纯主机名(localhost)拦截不提示 FAKE_IP_CIDRS
There was a problem hiding this comment.
Pull request overview
该 PR 改进了 URL 安全校验(assertPublicHttpUrl / assertPublicHttpUrlResolved)在拦截私有/本地网络目标时的错误提示信息,使报错更具体(包含实际 hostname 或解析得到的被拦截 IP),并在存在具体 IP 时提示可通过 FAKE_IP_CIDRS 放行。
Changes:
assertPublicHttpUrl:在拦截时展示被拦截的 hostname,并在目标为 IP 时追加FAKE_IP_CIDRS放行提示示例。assertPublicHttpUrlResolved:收集并展示所有被拦截的解析 IP 列表,并追加FAKE_IP_CIDRS放行提示示例。
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
不采纳Copilot建议的理由:在我实际遇到的网络环境中,GitHub会被解析到一个触发误判的IP,并且每次解析的IP并不完全相同,所以通常必须豁免足够宽泛的整个子网 |
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.
assertPublicHttpUrl 和 assertPublicHttpUrlResolved 报错时: