Skip to content

x/net/webdav: PUT with missing intermediate collection gave 404, MUST be 409 [RFC4918:S9.7.1]) #67150

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

Closed
vvatanabe opened this issue May 3, 2024 · 1 comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted.
Milestone

Comments

@vvatanabe
Copy link

Go version

go version go1.22.2 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/vvatanabe/Library/Caches/go-build'
GOENV='/Users/vvatanabe/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/vvatanabe/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/vvatanabe/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.22.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.22.2/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/vvatanabe/go/src/github.com/golang/net/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/gq/yp0c_j9j6q92thtm16lbd78m0000gn/T/go-build626879434=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Run the litmus WebDAV testsuite against the x/net/webdav test server at https://github.com/golang/net/blob/master/webdav/litmus_test_server.go:

$ go run webdav/litmus_test_server.go
$ git clone https://github.com/notroj/litmus.git
$ cd litmus
$ make URL=http://localhost:9999/ check

The following playground can also be used https://go.dev/play/p/DJB2UX3d2rL .

What did you see happen?

Test case (5. put_no_parent) fails when running litmus test:

$ make URL=http://localhost:9999/ check
-> running `basic':
 0. init.................. pass
 1. begin................. pass
 2. options............... pass
 3. put_get............... pass
 4. put_get_utf8_segment.. pass
 5. put_no_parent......... FAIL (PUT with missing intermediate collection gave 404, MUST be 409 [RFC4918:S9.7.1])

What did you expect to see?

Expected basic test 5. put_no_parent to succeed, RFC4918:S9.7.1 clearly states that a 409 must be returned in this case.

A PUT that would result in the creation of a resource without an appropriately scoped parent collection MUST fail with a 409 (Conflict).

@gopherbot gopherbot added this to the Unreleased milestone May 3, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/583055 mentions this issue: webdav: return 409 for PUT without parent collection

@cherrymui cherrymui added the FixPending Issues that have a fix which has not yet been reviewed or submitted. label May 6, 2024
wader added a commit to wader/caddy-webdav that referenced this issue Sep 26, 2024
mholt pushed a commit to mholt/caddy-webdav that referenced this issue Sep 26, 2024

Verified

This commit was signed with the committer’s verified signature.
awly Andrew Lytvynov
…on bug) (#48)

golang/go#67150
dt-eric-lefevreardant pushed a commit to DiliTrust/go-webdav that referenced this issue Mar 11, 2025

Verified

This commit was signed with the committer’s verified signature.
JanDeDobbeleer Jan De Dobbeleer
Aligning with the WebDAV RFC specification,
changes the server response for PUT operations that would
create a resource without an existing parent collection
from HTTP 404 Not Found to HTTP 409 Conflict.

RFC RFC4918, section 9.7.1

Fixes golang/go#67150

Change-Id: I5ce6c5ea147a6a450ef5ae2e0077eb0dce409743
Reviewed-on: https://go-review.googlesource.com/c/net/+/583055
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted.
Projects
None yet
Development

No branches or pull requests

3 participants