mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-22 04:16:38 +00:00
fix: the method for correcting judgment headers (#1159)
Co-authored-by: loverustfs <hello@rustfs.com>
This commit is contained in:
@@ -96,12 +96,16 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AssumeRole
|
// AssumeRole
|
||||||
if method == Method::POST && path == "/" {
|
if method == Method::POST
|
||||||
if let Some(val) = headers.get(header::CONTENT_TYPE) {
|
&& path == "/"
|
||||||
if val.as_bytes() == b"application/x-www-form-urlencoded" {
|
&& headers
|
||||||
return true;
|
.get(header::CONTENT_TYPE)
|
||||||
}
|
.and_then(|v| v.to_str().ok())
|
||||||
}
|
.map(|ct| ct.split(';').next().unwrap_or("").trim())
|
||||||
|
.map(|ct| ct == "application/x-www-form-urlencoded")
|
||||||
|
.unwrap_or(false)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
path.starts_with(ADMIN_PREFIX) || path.starts_with(RPC_PREFIX) || is_console_path(path)
|
path.starts_with(ADMIN_PREFIX) || path.starts_with(RPC_PREFIX) || is_console_path(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user