Skip to content

Commit

Permalink
fix: introduce uri validation for params
Browse files Browse the repository at this point in the history
  • Loading branch information
shipperizer committed Mar 26, 2024
1 parent e6dbf32 commit 5eecee4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pkg/idp/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ type API struct {

func (a *API) RegisterEndpoints(mux *chi.Mux) {
mux.Get("/api/v0/idps", a.handleList)
mux.Get("/api/v0/idps/{id}", a.handleDetail)
mux.Get("/api/v0/idps/{id:.+}", a.handleDetail)
mux.Post("/api/v0/idps", a.handleCreate)
mux.Patch("/api/v0/idps/{id}", a.handlePartialUpdate)
mux.Delete("/api/v0/idps/{id}", a.handleRemove)
mux.Patch("/api/v0/idps/{id:.+}", a.handlePartialUpdate)
mux.Delete("/api/v0/idps/{id:.+}", a.handleRemove)
}

func (a *API) handleList(w http.ResponseWriter, r *http.Request) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/schemas/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ type API struct {

func (a *API) RegisterEndpoints(mux *chi.Mux) {
mux.Get("/api/v0/schemas", a.handleList)
mux.Get("/api/v0/schemas/{id}", a.handleDetail)
mux.Get("/api/v0/schemas/{id:.+}", a.handleDetail)
mux.Post("/api/v0/schemas", a.handleCreate)
mux.Patch("/api/v0/schemas/{id}", a.handlePartialUpdate)
mux.Delete("/api/v0/schemas/{id}", a.handleRemove)
mux.Patch("/api/v0/schemas/{id:.+}", a.handlePartialUpdate)
mux.Delete("/api/v0/schemas/{id:.+}", a.handleRemove)
mux.Get("/api/v0/schemas/default", a.handleDetailDefault)
mux.Put("/api/v0/schemas/default", a.handleUpdateDefault)
}
Expand Down

0 comments on commit 5eecee4

Please sign in to comment.