Repository navigation
fix: reject malformed share ids, drop Content-Length on proxy rewrite… - #571
Open
GoodnessJohn wants to merge 1 commit into
Open
GoodnessJohn wants to merge 1 commit into
GoodnessJohn wants to merge 1 commit into
Conversation
…, fix Sentry tunnel 200-on-failure, surface BFF session upstream errors - Zenith-options#531: strip trailing slashes from share id query param and reject any id containing characters outside [A-Za-z0-9_.-] with 400 before crypto verification runs (src/app/api/og/trade/route.tsx) - Zenith-options#532: explicitly delete content-length from the upstream request headers in proxy() so a rewritten body never causes the backend to read a truncated or padded payload; the runtime derives the correct length from the actual body (src/lib/bff/handlers.ts) - Zenith-options#533: implement the Sentry envelope tunnel route that was missing. Returns 502 when the upstream ingest call fails or returns non-2xx so the SDK can retry; returns 200 only on success. Restricts forwarding to *.sentry.io hosts. Never logs the envelope body (src/app/api/sentry-tunnel/route.ts) - Zenith-options#534: rewrite getSession to distinguish three failure modes: network unreachable → 502 { error, upstreamStatus: null }; backend non-2xx (excluding 401) → 502 { error, upstreamStatus }; backend 401 → clear cookie and return unauthenticated 200; backend 2xx → session info 200 (src/lib/bff/handlers.ts)
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.
…, fix Sentry tunnel 200-on-failure, surface BFF session upstream errors
closes #531: strip trailing slashes from share id query param and reject any id containing characters outside [A-Za-z0-9_.-] with 400 before crypto verification runs (src/app/api/og/trade/route.tsx)
closes #532: explicitly delete content-length from the upstream request headers in proxy() so a rewritten body never causes the backend to read a truncated or padded payload; the runtime derives the correct length from the actual body (src/lib/bff/handlers.ts)
closes #533: implement the Sentry envelope tunnel route that was missing. Returns 502 when the upstream ingest call fails or returns non-2xx so the SDK can retry; returns 200 only on success. Restricts forwarding to *.sentry.io hosts. Never logs the envelope body (src/app/api/sentry-tunnel/route.ts)
closes #534: rewrite getSession to distinguish three failure modes: network unreachable → 502 { error, upstreamStatus: null }; backend non-2xx (excluding 401) → 502 { error, upstreamStatus }; backend 401 → clear cookie and return unauthenticated 200; backend 2xx → session info 200 (src/lib/bff/handlers.ts)
Summary
Changes
Testing
Checklist