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: redundant trailing slash when accessing root directory #31983

Closed
lesykm opened this issue May 11, 2019 · 1 comment
Closed

x/net/webdav: redundant trailing slash when accessing root directory #31983

lesykm opened this issue May 11, 2019 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@lesykm
Copy link

lesykm commented May 11, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mlesyk/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mlesyk/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/go-1.12"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.12/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build990918272=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Using simplest webdav server ( source here: https://gist.github.com/lesykm/e21c765331fa5af7dd00652dfe671eb5 )

  1. go get golang.org/x/net/webdav
  2. curl -qs https://gist.githubusercontent.com/lesykm/e21c765331fa5af7dd00652dfe671eb5/raw/e967a66d5018e2f456ead82132f412c475b59401/main.go --output main.go
  3. go run main.go
  4. echo '<?xml version="1.0"?><a:propfind xmlns:a="DAV:"><a:prop><a:resourcetype/></a:prop></a:propfind>' | curl -qs -X PROPFIND http://127.0.0.1:8080/ --upload-file - | xmllint --format -

What did you expect to see?

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>/</D:href>
    <D:propstat>
      <D:prop>
        <D:resourcetype>
          <D:collection xmlns:D="DAV:"/>
        </D:resourcetype>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>

What did you see instead?

<?xml version="1.0" encoding="UTF-8"?>
<D:multistatus xmlns:D="DAV:">
  <D:response>
    <D:href>//</D:href>
    <D:propstat>
      <D:prop>
        <D:resourcetype>
          <D:collection xmlns:D="DAV:"/>
        </D:resourcetype>
      </D:prop>
      <D:status>HTTP/1.1 200 OK</D:status>
    </D:propstat>
  </D:response>
</D:multistatus>

Difference:

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <D:multistatus xmlns:D="DAV:">
   <D:response>
-    <D:href>/</D:href>
+    <D:href>//</D:href>
     <D:propstat>
       <D:prop>
         <D:resourcetype>

Breaking change was introduced in golang/net#32

This leads to incorrect display of root directory source in different webdav clients.

@gopherbot gopherbot added this to the Unreleased milestone May 11, 2019
@andybons andybons added the NeedsFix The path to resolution is known, but the work has not been done. label May 13, 2019
@gopherbot
Copy link

Change https://golang.org/cl/176737 mentions this issue: webdav: remove redundant trailing slash for root directory

@golang golang locked and limited conversation to collaborators Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants