Feature: on Go 1.22 pattern can start with an optional HTTP Method
sonatard opened this issue ยท 5 comments
sonatard commented
Since Go 1.22, it has become possible to specify HTTP Methods in the Path. Does chi plan to support this feature?
mux := http.ServeMux()
mux.Handle("GET /user/{id}", userHandler)
pkieltyka commented
are you wondering if chi's .Handle() method should also support the method prefix..? we certainly could add support for it pretty easily without any breaking changes. If others want it as well, I'll add it
sonatard commented
are you wondering if chi's .Handle() method should also support the method prefix..?
๐
r := chi.NewRouter()
r.Handle("GET /user/{id}", userHandler)
Spartan09 commented
are you wondering if chi's .Handle() method should also support the method prefix..? we certainly could add support for it pretty easily without any breaking changes. If others want it as well, I'll add it
Can I give it a shot?
Spartan09 commented
I have opened a pull request
pkieltyka commented
merged :) thanks @Spartan09 for the PR