Use tower-http corslayer for handling cors#1604
Open
zealsham wants to merge 1 commit into
Open
Conversation
Collaborator
Coverage Report for CI Build 27005289820Coverage increased (+0.08%) to 85.436%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This pr addresses part of payjoin#941. it replaces the custom cors handling with tower-http corslayer
Mshehu5
approved these changes
Jun 6, 2026
Mshehu5
reviewed
Jun 6, 2026
| /// - `(POST, "/")` => relay to default gateway (needed for backwards-compatibility only) | ||
| /// - `(POST, /http(s)://...)` => RFC 9540 opt-in gateway specified in path | ||
| /// - `(GET, /http(s)://...)` => OHTTP bootstrap via WebSocket with opt-in gateway | ||
| /// - `(OPTIONS, _)` => CORS preflight handling (handled by `tower_http::cors::CorsLayer`) |
Contributor
There was a problem hiding this comment.
utACK
nit: Could we add a comment a like this next to the CorsLayer setup since OPTIONS is handled by CorsLayer not is_relay_re quest could be more would help
Collaborator
Author
There was a problem hiding this comment.
A little confuse on what you mean due to wordings. However cors isnt just for options request, it handles both origin in request and access-control* in response
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.
This pr addresses part of #941. it replaces the custom cors handling with tower-http corslayer
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.