fix(relay): 本文が JSON の null のとき relay/jpyc と csv-pass/relay が 500 になるのを 400 にする (B-R6f・掟 15) - #624
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
…のを 400 にする (B-R6f・掟 15) 第 6 回レビュー R6b の characterization で判明。JSON.parse が null を返すと raw.chainId で TypeError → 500 + Sentry event になっていた。JSON.parse の直後に object 以外を 400 invalid_payload で返す検査を足す (追加のみ・register/claim と relay/status と同じ線)。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc
… 本文を 400 で返す (B-R6f) レビューで同じ型 (parse 結果が null のまま欄を読む → TypeError) の route が 4 つ見つかった。 siwe/verify は未ログインで到達でき 503 verify_failed + Sentry になっていた。 いずれも既存の invalid_json と同じ 400 を、欄を読む前に返す (追加のみ)。 freee の 2 route は SIWE の後ろで inert のため、テストは siwe/billing の 2 件を追加。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc
…ー反映) billing/settle は money-path なので、文字列/数値の本文の error code (invalid_chain) を変えず JSON の null だけを 400 invalid_json にする (pro/subscribe と同じ線)。freee mapping/sync は 既存の integration test の helper で null 本文 → 400 を固定した。 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc
cipherwebllc
force-pushed
the
fix/r6-b6f-null-body
branch
from
September 24, 2026 17:06
2995859 to
5d6e9b0
Compare
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.
概要
第 6 回レビュー Phase 6 の R6b (#623) の characterization で見つかった既存の問題です (B-R6f)。
JSON.parse(またはreq.json()) の結果が JSON のnullのとき、そのまま欄を読んで TypeError になり、500 (または 503) と Sentry event を出す route が 6 つありました。POST /api/relay/jpyc(money-path)invalid_payloadPOST /api/csv-pass/relay(money-path)invalid_payloadPOST /api/auth/siwe/verify(未ログインで到達可)verify_failed+ Sentryinvalid_jsonPOST /api/billing/settle(money-path)invalid_json(nullだけ)POST /api/freee/mapping・/api/freee/sync(SIWE の後ろ・機能は保留中)invalid_json変更 (掟 12 の「追加のみ」)
parse の直後に検査を 1 つ足しただけです。error code は各 route が既に持つもの (relay は欄不足と同じ
invalid_payload、他はinvalid_json) を使い、既存の制御フロー・応答・エラー処理は変えていません。money-path の billing/settle はnullだけを対象にし、文字列や数値の本文は従来どおりinvalid_chainのままです。検証
null本文 → 400) は、それぞれのガードを外すと落ちます。nullだけに絞る・freee のテスト追加、どちらも反映済み)。🤖 Generated with Claude Code
https://claude.ai/code/session_01HeizmagJBgL5peL5mQpxkc