Skip to content

Commit 89431af

Browse files
committed
body fix for whitelist
1 parent e287192 commit 89431af

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

rweng/rweng.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ func (e *Eng) ProcessRequest(w http.ResponseWriter, r *http.Request) {
5959
buri := bytes.ToLower([]byte(r.RequestURI))
6060
if rgx.Match(buri) {
6161
e.logger.Warn("Bypassing: Whitelisted URL found.", zap.String("Regexp", rgx.String()), zap.ByteString("URI", buri))
62+
body := ioutil.NopCloser(bytes.NewReader(b))
63+
64+
r.Body = body
65+
r.ContentLength = int64(len(b))
66+
r.Header.Set("Content-Length", strconv.Itoa(len(b)))
67+
6268
return
6369
}
6470
}

0 commit comments

Comments
 (0)