fix: correct nearIntentsBaseURL#547
Conversation
WalkthroughThe base URL for the Changes
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| solverRelayBaseURL: "https://solver-relay-v2.chaindefuser.com", | ||
| managerConsoleBaseURL: "https://api-mng-console.chaindefuser.com/api/", | ||
| nearIntentsBaseURL: "https://app.near-intents.org/api/", | ||
| nearIntentsBaseURL: "https://near-intents.org/api/", |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Verify reachability & downstream concatenation assumptions for new base URL
The domain changed from app.near-intents.org to near-intents.org.
- Make sure the new endpoint is already live and does not rely on HTTP → HTTPS or sub-domain redirects, otherwise SDK calls will break in production.
- All call-sites that append path segments must account for the preserved trailing slash; absence/presence mismatches can silently produce URLs with double slashes or missing separators.
Run the quick grep below to surface any concatenations that may already include a leading slash (look for /${config.env.nearIntentsBaseURL}-style patterns):
🏁 Script executed:
#!/bin/bash
# List files where nearIntentsBaseURL is concatenated with a literal '/'
rg --line-number --fixed-strings "${config.env.nearIntentsBaseURL}/" || trueLength of output: 122
🏁 Script executed:
#!/bin/bash
# Search for all references to nearIntentsBaseURL to inspect how it’s used/concatenated
rg --line-number -C2 "nearIntentsBaseURL" || trueLength of output: 1197
🏁 Script executed:
#!/bin/bash
set -e
echo "Testing production endpoint (near-intents.org/api/):"
curl -Is http://near-intents.org/api/ | head -n1
curl -Is https://near-intents.org/api/ | head -n1
echo
echo "Testing stage endpoint (stage.near-intents.org/api/):"
curl -Is http://stage.near-intents.org/api/ | head -n1
curl -Is https://stage.near-intents.org/api/ | head -n1Length of output: 555
Confirm direct HTTPS & trailing‐slash behavior for nearIntentsBaseURL
File: src/config.ts
Line: 34
nearIntentsBaseURL: "https://near-intents.org/api/",Requests to both near-intents.org/api/ and stage.near-intents.org/api/ currently return HTTP 301/308 redirects:
- http://…/api/ → 301 Moved Permanently (to HTTPS)
- https://…/api/ → 308 Permanent Redirect
- Ensure your SDK’s HTTP client automatically follows these redirects in production, or update the base URL to point directly at the final HTTPS endpoint (e.g.
https://near-intents.org/apiwithout the trailing slash) to avoid extra round-trips or potential breakage. - I searched for all
nearIntentsBaseURLreferences and found one concatenation:
• src/queries/solverLiquidityQuerires.ts (line 20):This is correct given the trailing slash. No other call-sites append a leading slash—please keep future concatenations consistent with the preserved slash semantics to prevent malformed URLs.url: `${globalConfig.env.nearIntentsBaseURL}solver_liquidity`
🤖 Prompt for AI Agents
In src/config.ts at line 34, the nearIntentsBaseURL includes a trailing slash
causing HTTP redirects when used. To fix this, remove the trailing slash from
the URL to directly use the final HTTPS endpoint (change to
"https://near-intents.org/api"). Also, ensure all future URL concatenations
respect this no-trailing-slash format by adding slashes explicitly in
concatenations to avoid malformed URLs, as currently done in
src/queries/solverLiquidityQuerires.ts line 20.
## [1.0.0-beta.203](v1.0.0-beta.202...v1.0.0-beta.203) (2025-07-17) ### Bug Fixes * correct nearIntentsBaseURL ([#547](#547)) ([7b15f1d](7b15f1d))
|
🎉 This PR is included in version 1.0.0-beta.203 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary by CodeRabbit