-
Notifications
You must be signed in to change notification settings - Fork 18k
x/net/webdav: no trailing slash on href to a directory #29858
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
Comments
Does the spec say anything about this? |
In RFC 4918:
|
other webdav server - installApache webdav:
Sabre dav via Nextcloud:Creating an account on their demo other webdav server - testvia curl:
observation:On both servers, the href attribute in the xml end with a "/" for collections. Example response using the Apache webdav with 2 things inside the webdav folder: 1 directory called "test" and a file called test.html
the href field has a "/" at the end of the HREF for directories |
CC @rsto |
The patch LGTM. Just curious: is the trailing |
No idea, personally, I wanted to use this as an optimisation in this project to reduce the network round trip as my data isn't store locally but on some remote backends: S3, FTP, SFTP, ... |
Also, let me know if I'm wrong but the current implementation of the webdav server seems to assume that opening a file and performing a stat is a cheap operation. In my scenario trying to make a webdav server of an S3 bucket, such an assumption is not true and is large of a consequence when the webdav server is mounted on the OS. To fix this, I made some additional changes in the webdav implementation to avoid unnecessary file opening, stats and close in the request lifecycle. Any chance that this problem of unnecessary file opening could be fix in the meantime? |
I only skimmed them briefly, but I think both changes are broadly acceptable (as two separate changes). The contribution guidelines are at If you haven't submitted a Go patch before, note that we will need https://golang.org/doc/contribute.html#cla If you're familiar with GitHub's flow, you might want to follow https://golang.org/doc/contribute.html#sending_a_change_github which is a relatively new process. |
Change https://golang.org/cl/163863 mentions this issue: |
This is a test to fix golang/go#29858 When passed the "/" directory, it adds an additional "/" which upsets some clients (duplicacy for instance).
Fixes golang/go#29858 Change-Id: I7bd8357a7def7daab1fd6357a888ff4e676a1bee GitHub-Last-Rev: a6dc776fa3aad595643943dcff88efcf152d6be1 GitHub-Pull-Request: golang/net#32 Reviewed-on: https://go-review.googlesource.com/c/163863 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I've created a webdav server based on https://godoc.org/golang.org/x/net/webdav then started querying it:
What did you expect to see?
Like other webdav servers I made some test with, I expected the href attribute to end with a "/" for directories
What did you see instead?
The href attribute never end with a "/"
I made a quick fix as this piece of code is a big deal in the context of where I'm using the webdav server for.
The text was updated successfully, but these errors were encountered: