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

Invalid routing on multiple tailcards #876

Closed
vonox7 opened this issue Jan 15, 2019 · 4 comments
Closed

Invalid routing on multiple tailcards #876

vonox7 opened this issue Jan 15, 2019 · 4 comments
Assignees
Milestone

Comments

@vonox7
Copy link

vonox7 commented Jan 15, 2019

A request to http://localhost:8090/asdf should not be handled by any route but is in Ktor 1.1.1 handled by the "ADMIN" route.

embeddedServer(Netty, port = 8090) {
      // http://localhost:8090/admin-prefix-hello --> "ADMIN" (OK)
      // http://localhost:8090/subdirectory/hello --> "Wildcard 404" (OK)
      // http://localhost:8090/asdf --> "ADMIN" (WHAT? Why did it take that route?)
      install(Routing) {
        route("admin-prefix-{...}", HttpMethod.Get) {
          handle {
            call.respond("ADMIN")
          }
        }
        route("subdirectory") {
          route("{...}", HttpMethod.Get) {
            handle {
              call.respond("Wildcard 404")
            }
          }
        }
      }
    }.start()
@orangy
Copy link
Contributor

orangy commented Jan 15, 2019

Thanks for a report, we'll investigate.

PS: As a side question, is there a reason you don't use get("…") { } instead of route/handle?

@vonox7
Copy link
Author

vonox7 commented Jan 15, 2019

Because I copy pasted the example from various sources, tried to find the minimum prototype to reproduce this error ;)

cy6erGn0m pushed a commit that referenced this issue Jan 16, 2019
@cy6erGn0m cy6erGn0m added this to the 1.1.2 milestone Jan 16, 2019
cy6erGn0m pushed a commit that referenced this issue Jan 16, 2019
@cy6erGn0m
Copy link
Contributor

Fixed

@vonox7
Copy link
Author

vonox7 commented Jan 16, 2019

That was prompt! Thanks!

jonasbark pushed a commit to jonasbark/ktor that referenced this issue Jan 16, 2019
* commit 'a7b406cf34cbaf1a767d226701003965d9f2740a': (28 commits)
  Improve HTTP client engine container documentation
  Add tailcard prefix support (ktorio#876, ktorio#526)
  Fix semaphore leave(locked coroutine without thread)
  Fix CIO headers parsing
  Fix client websocket nonce size
  Fix scheme parsing
  Await skipCancel in CIO client response pipeline
  Introduce default ktor exceptions and parameters delegation support
  Add word to dictionary
  Pull application property to ApplicationEngine interface
  Fix loosing errors in StatusPages if there was already a response sent
  Apply workaround to kotlin gradle MPP plugin bug
  Prohibit settings session after responding call
  Client: Support relative redirects by making #takeFrom() resolve relative urls. (ktorio#849)
  Add base64 cookies tests (related to ktorio#690)
  Move NonceManager to ktor-utils
  Reformat code according to the new codestyle
  Introduce NonceManager instead of OAuth2StateProvider
  Introduce withReplacedParameter on HttpAuthHeader
  Fix concurrent MessageDigest usage in server digest auth provider
  ...
schleinzer pushed a commit to schleinzer/ktor that referenced this issue Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants