Skip to content

Commit

Permalink
Allowing empty hosts to match against.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynom committed Oct 16, 2017
1 parent c8f9ebb commit d3fcb7b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,15 @@ func newProxy(l log.Logger, backend *url.URL) *httputil.ReverseProxy {
type httpHandler func(h http.Handler) http.Handler

func decorateHandler(l log.Logger, h http.Handler, b *ratelimit.Bucket) http.Handler {
decorators := []httpHandler{
handlers.NewValidateURLParameter(l, allowedHosts),
decorators := []httpHandler{}

if len(allowedHosts) > 0 {
decorators = append(
decorators,
handlers.NewValidateURLParameter(
l,
allowedHosts,
))
}

if len(allowedImaginaryParams) > 0 {
Expand Down

0 comments on commit d3fcb7b

Please sign in to comment.