fix: move token price chart proxy from bff to cow fi#7009
fix: move token price chart proxy from bff to cow fi#7009kernelwhisperer wants to merge 1 commit intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR replaces an external AWS API endpoint with an internal Next.js API proxy route. A new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@apps/cow-fi/app/api/proxies/tokens/route.ts`:
- Around line 9-18: The upstream fetch to UNISWAP_GRAPHQL_URL (the call
assigning upstreamResponse) lacks timeout and error handling; wrap the fetch in
a try/catch and use the shared timeout helper (prefer import of withTimeout or
fetchWithTimeout from `@cowprotocol/common-utils`) to abort slow requests, falling
back to AbortSignal.timeout() if the helper isn't available, and on errors
return a controlled Response (with appropriate status and message) instead of
letting the exception bubble; ensure headers/body/cache usage remains the same
and reference the existing upstreamResponse fetch call when implementing the
change.
🧹 Nitpick comments (1)
apps/cow-fi/app/api/proxies/tokens/route.ts (1)
3-4: Origin spoofing is fragile — document the reason and risk.Spoofing
OriginandRefererto impersonateapp.uniswap.orgworks today but will silently break if Uniswap tightens validation (e.g., API keys, IP-based rate limits, additional header checks). A brief comment documenting why this is necessary and the associated risk would help future maintainers.
|
Closing in favor of cowprotocol/bff#202 |
Summary
Fixing https://nomevlabs.slack.com/archives/C0361CDG8GP/p1769437579528819

Summary by CodeRabbit
Refactor
Chores