mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
browser: Add user-agent header filter to gorilla mux route (#8040)
When a peer client which higher version sends a request to a peer server with lower version, the returned status code is 200 OK instead of 405 code. The reason is that the peer client request reaches the browser handler, which registers itself by '/minio' route but without any other constraints. Adding filtering by user agent header to the browser route so internal requests to old endpoints versions return 405 error code.
This commit is contained in:
committed by
Harshavardhana
parent
af36c92cab
commit
cea3e3f7a6
@@ -1232,6 +1232,7 @@ func newWebRPCRequest(methodRPC, authorization string, body io.ReadSeeker) (*htt
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Header.Set("User-Agent", "Mozilla")
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
if authorization != "" {
|
||||
req.Header.Set("Authorization", "Bearer "+authorization)
|
||||
|
||||
Reference in New Issue
Block a user