Skip to content

Commit

Permalink
Merge pull request #38 from superfly/tp/fix-autoshutdown-with-allowed…
Browse files Browse the repository at this point in the history
…-paths

always remove pending request, even if path isn't allowed
  • Loading branch information
zifnab06 authored Jul 23, 2024
2 parents ef49c69 + a83fd0c commit 7101c24
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dockerproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ func dockerProxy() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
pendingRequests.Add(1)

defer func() {
pendingRequests.Add(^uint64(0))
}()

allowed := false
for _, allowedPath := range allowedPaths {
if allowedPath.MatchString(r.URL.Path) {
Expand All @@ -274,10 +278,6 @@ func dockerProxy() http.Handler {
return
}

defer func() {
pendingRequests.Add(^uint64(0))
}()

reverseProxy.ServeHTTP(w, r)
})
}
Expand Down

0 comments on commit 7101c24

Please sign in to comment.