Fix: Remove legacy app_id header to support self-hosting with Caddy - #2886
Fix: Remove legacy app_id header to support self-hosting with Caddy#2886abshari wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe Changes
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This is a localized header rename for file uploads, and no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. 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 |
What this PR does
This PR removes the legacy
app_idheader from theuploadFileStorage API method, ensuring we only send the compliant'app-id'header.Why this is necessary
Currently, the
@instantdb/coreclient sends the App ID for file uploads using both'app-id'and the legacyapp_idHTTP headers. The'app-id'header was recently added on August 6th, but the old underscored header was left behind.The official self-hosting
docker-compose.ymluses Caddy as the reverse proxy. Caddy has a strict, hardcoded security rule that silently drops any HTTP headers containing underscores, and there is no configuration option to override this behavior. Furthermore, sending headers with underscores can cause other strict reverse proxies (like Nginx) to behave unpredictably or reject requests entirely depending on configuration.By removing the legacy underscored header, we ensure the client strictly sends the compliant dash version (
app-id). The InstantDB backend already seamlessly acceptsapp-id, so this cleanup entirely resolves the broken upload flow for self-hosters without requiring any server-side changes.Testing
app_idheader and strictly usingapp-idsuccessfully bypasses Caddy and allows file uploads to complete on a self-hosted instance.