Skip to content

Routing handling with filters #318

@maiph

Description

@maiph

Hello there 😃
Found it while looking for open source projects to contribute to and this is something I was interested in and that I could learn from.

I would like to know what was the design decision on the request routing implementation.
It seems like you register a ServletFilter to the ServletContextHandler and call the route callback inside the doFilter.
https://github.com/hexagonkt/hexagon/blob/59d77521d41c507fa7b179c39984b74c058b8c5e/http_server_servlet/src/main/kotlin/ServletFilter.kt#L143
and then
https://github.com/hexagonkt/hexagon/blob/59d77521d41c507fa7b179c39984b74c058b8c5e/http_server_servlet/src/main/kotlin/ServletFilter.kt#L98

What I noticed is that you are not following the expected behaviour of the Filter behaviour by not calling the doFilter of the chain.

Just wanted to understand if this was done for a specific reason or just as a "cost cut" measure and take advantage of how the servlet context handler handles requests.
I also think there is something already in jetty that does some kind of routing based on the request path.

Loving the project and learning a lot from it ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions