x/net/webdav: MOVE
interprets lack of Overwrite
header incorrectly
#67939
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go version go1.22.4 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I'm using a client that issues a
MOVE
but doesn't include anOverwrite
header to a Go web server that uses the x/net/webdav code.What did you see happen?
The Go WebDAV server responds with a 412 HTTP status code and "file already exists" as the error. This is incorrect.
What did you expect to see?
I would expect to see a 200 HTTP status code and for the destination file to be overwritten.
It appears that this line of code is incorrect (google link).
It's passing
true
to theoverwrite
argument ofmoveFiles
only if theOverwrite
header isT
, but the WebDAV RFC section 10.6 states:Interestingly, the
COPY
code just a few lines before checks for this correctly (google link).The text was updated successfully, but these errors were encountered: