debian-mirror-gitlab/workhorse/internal/upstream/notfoundunless.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
179 B
Go
Raw Normal View History

2021-02-22 17:27:13 +05:30
package upstream
import "net/http"
func NotFoundUnless(pass bool, handler http.Handler) http.Handler {
if pass {
return handler
}
return http.HandlerFunc(http.NotFound)
}