Skip to content

Commit

Permalink
require correct / number
Browse files Browse the repository at this point in the history
  • Loading branch information
dropwhile committed Aug 21, 2023
1 parent e4953d5 commit 69724bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/camo/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// split path and get components
components := strings.Split(req.URL.Path, "/")
compLen := len(components)
if compLen < 3 {
if compLen < 3 || compLen > 4 {
http.Error(w, "Malformed request path", http.StatusNotFound)
return
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (dr *DumbRouter) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}

compLen := strings.Count(r.URL.Path, "/")
if compLen == 3 || compLen == 4 {
if compLen == 2 || compLen == 3 {
dr.CamoHandler.ServeHTTP(w, r)
return
}
Expand Down

0 comments on commit 69724bf

Please sign in to comment.