Skip to content

Commit

Permalink
body fix for whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
cjimti committed Jun 29, 2018
1 parent e287192 commit 89431af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rweng/rweng.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ func (e *Eng) ProcessRequest(w http.ResponseWriter, r *http.Request) {
buri := bytes.ToLower([]byte(r.RequestURI))
if rgx.Match(buri) {
e.logger.Warn("Bypassing: Whitelisted URL found.", zap.String("Regexp", rgx.String()), zap.ByteString("URI", buri))
body := ioutil.NopCloser(bytes.NewReader(b))

r.Body = body
r.ContentLength = int64(len(b))
r.Header.Set("Content-Length", strconv.Itoa(len(b)))

return
}
}
Expand Down

0 comments on commit 89431af

Please sign in to comment.