Normalize WATCHLIST to WATCH in metrics

This causes confusion and doesn't match what we authorize on
pull/6/head
Clayton Coleman 2017-09-09 14:01:52 -04:00
parent 2a9c8df2ec
commit 5e46d5b545
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3
1 changed files with 4 additions and 0 deletions

View File

@ -106,6 +106,10 @@ func MonitorRequest(request *http.Request, verb, resource, subresource, scope, c
}
}
}
// normalize the legacy WATCHLIST to WATCH to ensure users aren't surprised by metrics
if verb == "WATCHLIST" {
reportedVerb = "WATCH"
}
client := cleanUserAgent(utilnet.GetHTTPClient(request))
Monitor(reportedVerb, resource, subresource, scope, client, contentType, httpCode, respSize, reqStart)