Server returns 200 (soft 404) for non-existent routes instead of a real 404

オープン
#6,463 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
backend, web-dev

調査の方向性

Start by tracing the server's SPA fallback and route-matching handling, then reproduce the request to /this-page-does-not-exist in a deployed Reflex app. Done means undefined routes return HTTP 404 while valid dynamic routes and other runtime-resolved paths continue to work.

索引モデルが issue の本文から書いたものです。

説明

bug

Describe the bug

Reflex apps return HTTP 200 for URLs that don't correspond to any real page, serving the SPA fallback as the response body. This is a soft 404: the page doesn't exist, but the server signals success. Crawlers, AI agents, and SEO tooling all treat the response as a valid page and try to extract content from what is effectively an error state.

The root cause is that the SPA fallback is doing double duty. It's how Reflex resolves dynamic routes and other runtime-resolved paths and it's what gets served when a URL doesn't match anything. Both cases hit the same fallback, so the server can't distinguish "valid dynamic route" from "nonexistent page"

We need to be able to distinguish between the two

To Reproduce

  1. Deploy any Reflex app.
  2. Request a URL that doesn't map to a defined page, e.g. /this-page-does-not-exist.
  3. Observe: response is 200 OK with the SPA fallback HTML.
  4. Expected: 404 Not Found.
主要言語
Python
スター
29k
フォーク
1.8k
平均マージ
3日 5時間
マージ済み PR(30日)
182

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

reflex-dev/reflex のほかの issue

reflex-dev/reflex の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。