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

Muxes are not composable #332

Open
empijei opened this issue Nov 22, 2021 · 2 comments
Open

Muxes are not composable #332

empijei opened this issue Nov 22, 2021 · 2 comments
Assignees
Labels
core enhancement New feature or request good first issue Good for newcomers v0.2

Comments

@empijei
Copy link
Contributor

empijei commented Nov 22, 2021

A nice feature of http.Mux is that it can be used as a handler, so users can set up separate parts of an application on separate muxes that share a common configuration (e.g. a set of interceptors) and then install them on the root mux.

This is currently not possible with GSW, and we should seriously consider doing it.

@empijei empijei added enhancement New feature or request core v0.2 labels Nov 22, 2021
@kele
Copy link
Collaborator

kele commented Dec 16, 2021

To clarify, you are not referring to the safehttp.ServeMux being composable with http.Mux, but with itself, i.e.:

var m1 safehttp.ServeMux
var m2 safehttp.ServeMux

var rootMux safehttp.ServeMux
// These two lines below would not compile.
rootMux.Handle(..., m1)
rootMux.Handle(..., m2)

Correct?

@empijei
Copy link
Contributor Author

empijei commented Dec 28, 2021

Correct.

@kele kele added the good first issue Good for newcomers label Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request good first issue Good for newcomers v0.2
Projects
None yet
Development

No branches or pull requests

2 participants