Prepend application url to app proxy url if it starts with / #6147
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.
WHY are these changes introduced?
Closes https://github.com/shop/issues-develop/issues/12741#issue-3249208952
This puts us at parity with webhook subscription URLs, which already have this feature.
WHAT is this pull request doing?
Appends the application url to the start of the proxy URL if the proxy URL starts with / .
Updates validations to allow / leading proxy URLs. Also ensures that only HTTP proxies are used.
How to test your changes?
pnpm shopify app init
[app_proxy]
url = "https://www.api.example.com/api/proxy2"
subpath = "store-pickup"
prefix = "apps"
Substituting focused-share-holder app with your app name:
pnpm shopify app deploy --path=./focused-shareholder-app
should succeedhttps://www.api.example.com/api/proxy2
http://www.api.example.com/api/proxy2
pnpm shopify app deploy --path=./focused-shareholder-app
should fail with an HTTP validation./api/proxy2
pnpm shopify app deploy --path=./focused-shareholder-app
should succeedhttps://example/com/api/proxy2
Measuring impact
How do we know this change was effective? Please choose one:
Checklist