Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch-all rules in the Gateway #28

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Catch-all rules in the Gateway #28

merged 1 commit into from
Feb 15, 2024

Conversation

alexbiehl
Copy link
Member

@alexbiehl alexbiehl commented Feb 15, 2024

This PR introduces a first class Catch-All rule. This is really a general redirect that rewrites the host of the request to a target domain and redirects to it.

This is meant to be an alternative to the various /{+path} catch-all file packages that we have around. Since URI template are not expressive enough to model the encoding requirements for some requests we introducing this new rule type.

-- adjustment.
let encodedSegments =
foldr
(\x -> ((char7 '/' <> urlEncodeBuilder True (Text.encodeUtf8 x)) <>))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've been bitten by this in the past. It's a little bit more involved than just calling some function to encode the url segments but this way we are encoding them with max. escaping now.

@alexbiehl alexbiehl merged commit 7be973b into main Feb 15, 2024
1 check passed
@alexbiehl alexbiehl deleted the alex/catch-all branch February 15, 2024 17:26
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.

3 participants