# \`fetch\_response\` 拒绝 HTTP 202 导致 IMDB 卡片失效

**URL:** https://meta.discourse.org/t/fetch-response-rejects-http-202-breaking-imdb-oneboxes/407725
**Category:** Bug
**Tags:** onebox, fixed
**Created:** [2026年七月15日 19:38 UTC](https://meta.discourse.org/t/fetch-response-rejects-http-202-breaking-imdb-oneboxes/407725 "2026-07-15T19:38:44Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2026年七月16日 09:56 UTC](https://meta.discourse.org/t/fetch-response-rejects-http-202-breaking-imdb-oneboxes/407725/3 "2026-07-16T09:56:01Z")

</div>

看起来 [imdb.com](http://imdb.com) 位于一个 WAF（Web 应用防火墙）之后，该防火墙会阻止抓取（从而也阻止了一键嵌入功能），所以我们恐怕对此无能为力，只能改进向用户显示的错误提示信息

> <https://github.com/discourse/discourse/pull/41764>
>
> Previously, when a site behind a bot-protection service answered a onebox fetch …with a JavaScript challenge — IMDb, for example, currently returns \`202 Accepted\` with an AWS WAF challenge page — the preview showed the baffling "the web server returned an error code of 202", a success code presented as an error with no hint of the actual cause.
> 
> This change detects the documented challenge headers (AWS WAF's \`x-amzn-waf-action\` and Cloudflare's \`cf-mitigated\`) in \`FinalDestination\` and shows a message explaining that the site requires visitors to pass a verification step in a web browser. Accepting 2xx statuses beyond 200 instead would not help: the challenge response carries no OpenGraph data, so the onebox would just come out silently blank.
> 
> Reported in https://meta.discourse.org/t/407725
> 
> \*\*BEFORE\*\*
> 
> \<img width="726" height="605" alt="2026-07-16 @ 09 51 32" src="https://github.com/user-attachments/assets/929b116d-d07a-4aca-a655-6c4b1d0db607" /\>
> 
> 
> \*\*AFTER\*\*
> 
> \<img width="718" height="685" alt="2026-07-16 @ 09 52 10" src="https://github.com/user-attachments/assets/7b555557-6cb4-40ac-a7dc-32bf2515e357" /\>

---

_[View the full topic](https://meta.discourse.org/t/fetch-response-rejects-http-202-breaking-imdb-oneboxes/407725)._
