fix: add twirp catch-all with proxy support for unmatched paths (#237)#238
Open
yinheli wants to merge 3 commits into
Open
fix: add twirp catch-all with proxy support for unmatched paths (#237)#238yinheli wants to merge 3 commits into
yinheli wants to merge 3 commits into
Conversation
Unmatched Twirp paths (e.g., ArtifactService) currently return 404 because Nitro marks the /twirp/ segment as handled without a catch-all. Add routes/twirp/[...path].ts to proxy them to DEFAULT_ACTIONS_RESULTS_URL, matching the pattern of the root catch-all in routes/[...path].ts. Fixes falcondev-oss#237
Node.js/undici does not respect HTTP_PROXY env vars by default. Add lib/proxy-agent.ts to create an undici ProxyAgent from env vars and inject it via fetchOptions.dispatcher. Also add undici as direct dep.
Collaborator
|
Thank you for your contribution. |
Author
|
@DrJume Thanks for the review! Here's the failure context and logs that motivate this PR. Our CI failure (artifact upload step): This happens during the Reproduction from #237: Our environment shows 500 instead of 404 (likely because the |
Verifies that unmatched /twirp/* paths (e.g. ArtifactService) are proxied instead of returning 404.
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.
GitHub Actions Cache Server only has Twirp routes for CacheService. Unmatched paths (e.g. ArtifactService) under /twirp/ return 404 because Nitro marks the segment as handled but no catch-all exists inside it.
Changes: