fix: use typed method allowance
This commit is contained in:
@@ -259,9 +259,14 @@ impl WipFsServer {
|
||||
fn metadata_error(&self, error: RequestMetadataError) -> Response<Vec<u8>> {
|
||||
match error {
|
||||
RequestMetadataError::NotFound => empty_response(StatusCode::NOT_FOUND),
|
||||
RequestMetadataError::MethodNotAllowed => Response::builder()
|
||||
.status(StatusCode::METHOD_NOT_ALLOWED)
|
||||
.header(ALLOW, "POST")
|
||||
error @ RequestMetadataError::MethodNotAllowed => Response::builder()
|
||||
.status(error.status())
|
||||
.header(
|
||||
ALLOW,
|
||||
error
|
||||
.allow()
|
||||
.expect("method-not-allowed metadata has an Allow value"),
|
||||
)
|
||||
.body(Vec::new())
|
||||
.expect("static method response is valid"),
|
||||
RequestMetadataError::UnsupportedMediaType => {
|
||||
|
||||
Reference in New Issue
Block a user