Skip to content

feat(default-source-url): Add default source URL#29

Merged
nakamuraos merged 1 commit into
mainfrom
feat/default-source-url
May 1, 2026
Merged

feat(default-source-url): Add default source URL#29
nakamuraos merged 1 commit into
mainfrom
feat/default-source-url

Conversation

@nakamuraos
Copy link
Copy Markdown
Contributor

@nakamuraos nakamuraos commented May 1, 2026

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 via PP_DEFAULT_SOURCE_URL and supports all existing schemes (http://, https://, s3:/, local:/). Requests with explicit full URLs are unaffected.

Changes

  • src/modules/cli/args.rs - new --default-source-url flag; 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 relative
  • src/modules/proxy/controller.rs - route handling updated to support default source resolution
  • src/common/config/loader.rs - load and expose PP_DEFAULT_SOURCE_URL from config
  • .env.sample - document the new variable

Test plan

  • Start proxy with PP_DEFAULT_SOURCE_URL=https://example.com and request a relative path (e.g. /image.jpg) - should resolve to https://example.com/image.jpg
  • Absolute URLs in requests still bypass the default source
  • Works with s3:/ and local:/ schemes as the default base
  • --help output shows env var name without duplication

@nakamuraos nakamuraos force-pushed the feat/default-source-url branch from 0dc3efb to 2e49944 Compare May 1, 2026 04:01
@nakamuraos nakamuraos merged commit 5bac6eb into main May 1, 2026
6 checks passed
@nakamuraos nakamuraos deleted the feat/default-source-url branch May 1, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant