Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/net/webdav: MOVE interprets lack of Overwrite header incorrectly #67939

Closed
caldwell opened this issue Jun 12, 2024 · 4 comments
Closed

x/net/webdav: MOVE interprets lack of Overwrite header incorrectly #67939

caldwell opened this issue Jun 12, 2024 · 4 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@caldwell
Copy link

Go version

go version go1.22.4 linux/amd64

Output of go env in your module/workspace:

not applicable

What did you do?

I'm using a client that issues a MOVE but doesn't include an Overwrite 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 the overwrite argument of moveFiles only if the Overwrite header is T, but the WebDAV RFC section 10.6 states:

If the overwrite header is not included in a COPY or MOVE request, then the resource MUST treat the request as if it has an overwrite header of value "T".

Interestingly, the COPY code just a few lines before checks for this correctly (google link).

@gopherbot gopherbot added this to the Unreleased milestone Jun 12, 2024
@gabyhelp
Copy link

Similar Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@seankhliao seankhliao changed the title x/net: webdav MOVE interprets lack of Overwrite header incorrectly x/net/webdav: MOVE interprets lack of Overwrite header incorrectly Jun 12, 2024
@prattmic prattmic added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 12, 2024
@prattmic
Copy link
Member

cc @neild @ianlancetaylor

@rsc
Copy link
Contributor

rsc commented Jun 12, 2024

Looks like a duplicate of #66059?

@seankhliao
Copy link
Member

Duplicate of #66059

@seankhliao seankhliao marked this as a duplicate of #66059 Jun 15, 2024
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants