feat(default-source-url): Add default source URL#29
Merged
Conversation
0dc3efb to
2e49944
Compare
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.
Overview
Allows deploying the proxy with a fixed upstream base so callers can request bare paths (e.g.
/photos/cat.jpg) instead of full URLs. The default source is configured once viaPP_DEFAULT_SOURCE_URLand supports all existing schemes (http://,https://,s3:/,local:/). Requests with explicit full URLs are unaffected.Changes
src/modules/cli/args.rs- new--default-source-urlflag; removed redundant[env: VAR_NAME]suffixes from doc comments (clap already renders these in--help)src/modules/proxy/service.rs- apply default source URL when request path is relativesrc/modules/proxy/controller.rs- route handling updated to support default source resolutionsrc/common/config/loader.rs- load and exposePP_DEFAULT_SOURCE_URLfrom config.env.sample- document the new variableTest plan
PP_DEFAULT_SOURCE_URL=https://example.comand request a relative path (e.g./image.jpg) - should resolve tohttps://example.com/image.jpgs3:/andlocal:/schemes as the default base--helpoutput shows env var name without duplication