fix: Context.BaseURL() returns full BASE_URL in single-host mode#1454
Open
3rg0n wants to merge 1 commit intogetfider:mainfrom
Open
fix: Context.BaseURL() returns full BASE_URL in single-host mode#14543rg0n wants to merge 1 commit intogetfider:mainfrom
3rg0n wants to merge 1 commit intogetfider:mainfrom
Conversation
Context.BaseURL() was always calling Request.BaseURL() which only returns scheme://host:port, stripping any path component from the configured BASE_URL. This broke all redirects and frontend navigation when Fider is hosted under a sub-path (e.g., BASE_URL=https://example.com/feedback). The package-level web.BaseURL() function already handled this correctly by returning env.Config.BaseURL in single-host mode. This change aligns the Context method with that behavior. Fixes getfider#1452 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7 tasks
3rg0n
added a commit
to 3rg0n/fider
that referenced
this pull request
Feb 13, 2026
Add docker-compose test setup with Caddy reverse proxy and self-signed certificates to test all deployment scenarios locally: - Scenario 1: Single-host without sub-path (https://fider.local) - Scenario 2: Single-host WITH sub-path (https://app.local/feedback) - Scenario 3: Multi-host with subdomains (https://*.multi.local) Includes detailed test checklists, setup scripts, and quick-start guide. Addresses maintainer request to test against all supported installation types before merging PRs getfider#1454 and getfider#1455. Files added: - docker-compose-test.yml: Multi-scenario test environment - Caddyfile.test: Reverse proxy config with automatic HTTPS - TEST-SCENARIOS.md: Detailed test checklists for each scenario - QUICK-TEST.md: Fast setup guide - TEST-README.md: Overview and architecture - setup-hosts.sh/ps1: Host file configuration scripts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Context.BaseURL()strips path fromBASE_URL, breaking subfolder/sub-path hosting #1452:Context.BaseURL()now returnsenv.Config.BaseURL(which includes the path component) when running in single-host mode, instead of callingRequest.BaseURL()which strips the path.ctx.BaseURL()to the frontend asFider.settings.baseURL, so the path component (e.g.,/feedback) was being lost.TestBaseURL_SingleHostModeandTestBaseURL_SingleHostMode_WithPath) and updated three existing tests to explicitly setHostMode = "multi".Test plan
TestBaseURL,TestBaseURL_HTTPS,TestBaseURL_HTTPS_Proxy,TestBaseURL_SingleHostMode,TestBaseURL_SingleHostMode_WithPath)go vetpasses on the changed packageBASE_URL=https://example.com/feedbackand verifyFider.settings.baseURLincludes/feedbackin the browser🤖 Generated with Claude Code