add audit/admin trace support for browser requests (#10947)

To support this functionality we had to fork
the gorilla/rpc package with relevant changes
This commit is contained in:
Harshavardhana
2020-11-20 22:52:17 -08:00
committed by GitHub
parent 7bc47a14cc
commit 86409fa93d
21 changed files with 2033 additions and 64 deletions

View File

@@ -1006,6 +1006,15 @@ func mustTrace(entry interface{}, trcAll, errOnly bool) bool {
if !ok {
return false
}
// Handle browser requests separately filter them and return.
if HasPrefix(trcInfo.ReqInfo.Path, minioReservedBucketPath+"/upload") {
if errOnly {
return trcInfo.RespInfo.StatusCode >= http.StatusBadRequest
}
return true
}
trace := trcAll || !HasPrefix(trcInfo.ReqInfo.Path, minioReservedBucketPath+SlashSeparator)
if errOnly {
return trace && trcInfo.RespInfo.StatusCode >= http.StatusBadRequest