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

fix: multiple strings to a single Handler #2913

Closed
wants to merge 17 commits into from

Conversation

varshith257
Copy link
Contributor

fixes #2815
/claim #2815

@varshith257 varshith257 requested a review from kyri-petrou June 17, 2024 02:25
@varshith257
Copy link
Contributor Author

@kyri-petrou Any suggestions on failing tests? The anyOf method implemented logic seems to be correct to achieve this behavior:

val routes: Routes[Any, Response] = 
        Routes( Method.GET / "" -> handHome, 
                     Method.GET / "index.html" -> handHome, 
                     Method.GET / "index.htm" -> handHome, 
                     Method.GET / "index" -> handHome )

// Transformed to:

val routes: Routes[Any, Response] = 
Routes( Method.GET / anyOf("", "index.html", "index.htm", "index") -> handHome )

@kyri-petrou
Copy link
Collaborator

kyri-petrou commented Jun 17, 2024

@kyri-petrou Any suggestions on failing tests? The anyOf method implemented logic seems to be correct to achieve this behavior:

@varshith257 AFAICT the code needs to be formatted. You just need to run sbt fmt and commit the changes

@varshith257
Copy link
Contributor Author

@kyri-petrou Done! But test suite seems failing :)

@kyri-petrou
Copy link
Collaborator

kyri-petrou commented Jun 18, 2024

I'm sorry @varshith257 but after looking into this, this implementation is impossible to work. The solution you brought forward is concatenating the paths in anyOf which is not what the ticket is meant to be about. Feel free to reopen a PR when you have a working implementation, but please test it locally first to ensure that it works

@varshith257 varshith257 deleted the fix-anyOf branch June 22, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple Strings to a single Handler
3 participants