Files
magpie/internal
yetone 65d6b1dee9 provider: ZCode's 3012 risk control is not told as an IP firewall
windy_66454 (Discord, 10-31, v0.1.2297) had every request to a ZCode
group answered "ZCode: 405 Method Not Allowed — the provider's network
firewall blocked requests from this IP; wait a while, or switch to
another network or proxy", and both members rested together on the
account as "why other".

The plugin tells ZCode's Start Plan 3012 ("request has been blocked due
to unusual activity", the account's risk control) apart from Alibaba
Cloud's block page: 3012 carries ZCodeRestrictedHint. APIError matched
"request has been blocked" with edgeBlocked first and rewrote the whole
body to "<status> — BlockedHint", so the restricted hint was cut, the
user was told to change networks, and the gateway rested the account
with failOther's backoff instead of failRestricted. A body that already
carries ZCodeRestrictedHint or WBRestrictedHint now keeps its words.

The reporter's text is what both cases read as before this, so which
one they met is not known from the text.

Run (mote, at this tree):
- TestZCodeRiskControlNotToldAsFirewall: red on the old provider/test.go
  (told "ZCode: 405 Method Not Allowed — the provider's network firewall
  ..."), green now; its block-page case still says BlockedHint and
  rests as failOther.
- go test ./internal/gateway -run 'ZCode|Edge|Relay|Restricted|WorkBuddy|Blocked|Refusal'
  and go test ./internal/provider: ok.
- gofmt -l clean; go vet darwin/linux/windows of gateway and provider ok.
Not tried: the reporter's real account; no ZCode account answers 3012
here.
2026-10-31 11:12:56 +08:00
..
…
…
…
…