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 authored and GitHub committed 2020-11-20 22:52:17 -08:00
1 parent 7bc47a14cc
commit 86409fa93d
21 files changed
+2033 -64

No files matched your search

+9
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