mirror of
https://git.proxmox.com/git/proxmox
synced 2025-08-06 17:52:06 +00:00
rest-server: use BAD_REQUEST for non-GET on file-paths
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
93c027f5cc
commit
a1119a3e63
@ -21,11 +21,11 @@ use tokio::time::Instant;
|
|||||||
use tower_service::Service;
|
use tower_service::Service;
|
||||||
use url::form_urlencoded;
|
use url::form_urlencoded;
|
||||||
|
|
||||||
use proxmox_router::http_err;
|
|
||||||
use proxmox_router::{
|
use proxmox_router::{
|
||||||
check_api_permission, ApiHandler, ApiMethod, HttpError, Permission, RpcEnvironment,
|
check_api_permission, ApiHandler, ApiMethod, HttpError, Permission, RpcEnvironment,
|
||||||
RpcEnvironmentType, UserInformation,
|
RpcEnvironmentType, UserInformation,
|
||||||
};
|
};
|
||||||
|
use proxmox_router::{http_bail, http_err};
|
||||||
use proxmox_schema::{ObjectSchemaType, ParameterSchema};
|
use proxmox_schema::{ObjectSchemaType, ParameterSchema};
|
||||||
|
|
||||||
use proxmox_async::stream::AsyncReaderStream;
|
use proxmox_async::stream::AsyncReaderStream;
|
||||||
@ -727,7 +727,7 @@ impl ApiConfig {
|
|||||||
// not Auth required for accessing files!
|
// not Auth required for accessing files!
|
||||||
|
|
||||||
if method != hyper::Method::GET {
|
if method != hyper::Method::GET {
|
||||||
bail!("Unsupported HTTP method {}", method);
|
http_bail!(BAD_REQUEST, "invalid http method for path");
|
||||||
}
|
}
|
||||||
|
|
||||||
if comp_len == 0 {
|
if comp_len == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user