Skip to content

Incorrect HTTP status code #12

@pmeiyu

Description

@pmeiyu

A 404 Not Found status code is returned when methods is set to "http-ro" or "webdav-ro" and a write method (PUT, PATCH, etc) is sent. The expected status code is 405 Method Not Allowed.

Config file:

[server]
listen = ["0.0.0.0:4918", "[::]:4918"]

[[location]]
auth = "false"
route = ["/*path"]
directory = "/srv/public"
handler = "filesystem"
methods = ["webdav-ro"]

The HTTP request:

-> touch /srv/public/test

-> curl -v -X PUT localhost:4918/test
*   Trying 127.0.0.1:4918...
* Connected to localhost (127.0.0.1) port 4918 (#0)
> PUT /test HTTP/1.1
> Host: localhost:4918
> User-Agent: curl/7.79.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< server: webdav-server-rs
< content-type: text/xml
< transfer-encoding: chunked
< date: Mon, 22 Nov 2021 07:01:30 GMT
<
<error>404 Not Found</error>
* Connection #0 to host localhost left intact

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions