Repository navigation
Hotfix: /api/v1 is an app route, not marketing - #61
Merged
Merged
Conversation
4 of 5 tasks
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.
Bug
After PR #60 (the same-origin proxy),
/api/v1/*requests onapp.nemar.orgwere being 301'd to ww2.nemar.org by the host-split middleware, because/api/v1wasn't inAPP_ROUTE_PREFIXES. The proxy was effectively unreachable from the app host.Verified live:
curl -sS -o /dev/null -w "%{http_code}" "https://app.nemar.org/api/v1/datasets?mine=true&limit=1"returns301.Fix
Add
/api/v1toAPP_ROUTE_PREFIXESwith a comment about WHY it has to be app-host-only (the cookie scope). Updated theisAppRoutetest to cover representative paths.Test plan
bun run typecheck— 0 errorsbun run test— 370/370 (+4 new app-route cases)bun run lint— cleancurl https://app.nemar.org/api/v1/datasets?mine=truereturns 401 (proxy reaches backend, backend returns 401 because no cookie) — not 301.