mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
azure: Fix crash after using ParseForm() for query param lookups (#13147)
Azure storage SDK uses http.Request feature which panics when the request contains r.Form popuplated. Azure gateway code creates a new request, however it modifies the transport to add our metrics code which sets Request.Form during shouldMeterRequest() call. This commit simplifies shouldMeterRequest() to avoid setting request.Form and avoid the crash.
This commit is contained in:
parent
1250312287
commit
42b1d92b2a
@ -388,7 +388,7 @@ func gatewayHandleEnvVars() {
|
|||||||
|
|
||||||
// shouldMeterRequest checks whether incoming request should be added to prometheus gateway metrics
|
// shouldMeterRequest checks whether incoming request should be added to prometheus gateway metrics
|
||||||
func shouldMeterRequest(req *http.Request) bool {
|
func shouldMeterRequest(req *http.Request) bool {
|
||||||
return !(guessIsBrowserReq(req) || guessIsHealthCheckReq(req) || guessIsMetricsReq(req))
|
return req.URL != nil && !strings.HasPrefix(req.URL.Path, minioReservedBucketPath+slashSeparator)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MetricsTransport is a custom wrapper around Transport to track metrics
|
// MetricsTransport is a custom wrapper around Transport to track metrics
|
||||||
|
Loading…
Reference in New Issue
Block a user