You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the internal HTTP client of go-webdav will send the request with the URL https://uXXXX.your-storagebox.de/asset1 and the method PROPFIND, but then the server will respond with HTTP status code 302 and a Location: https://uXXXX.your-storagebox.de/asset1/ header. This really shouldn't be an issue since the Golang HTTP client follows any redirects by default (I actually couldn't debug what I have just stated without disabling the automatic redirections following first). However the request made after the redirect loses its request method (PROPFIND) and always gets changed to a GET request, and here all the issues start (since as I said in the start, the Hetzner WebDAV server will respond with HTML if the request method isn't one of the WebDAV request verbs)
I don't really know why the HTTP client doesn't follow the redirections with the same request method of the original request, but I managed to solve it by creating my own Transport like that:
Hello,
I tried using your WebDAV client to access my Hetzner storage box through their WebDAV server (pretty sure they use Apache as their WebDAV server)
First off, I noticed how their WebDAV differs than most of the WebDAV servers I have used before:
So what's the issue?
If we perform a
Readdir
(for example) query on the Hetzner WebDAV server like that:the internal HTTP client of
go-webdav
will send the request with the URLhttps://uXXXX.your-storagebox.de/asset1
and the methodPROPFIND
, but then the server will respond with HTTP status code302
and aLocation: https://uXXXX.your-storagebox.de/asset1/
header. This really shouldn't be an issue since the Golang HTTP client follows any redirects by default (I actually couldn't debug what I have just stated without disabling the automatic redirections following first). However the request made after the redirect loses its request method (PROPFIND
) and always gets changed to aGET
request, and here all the issues start (since as I said in the start, the Hetzner WebDAV server will respond with HTML if the request method isn't one of the WebDAV request verbs)I don't really know why the HTTP client doesn't follow the redirections with the same request method of the original request, but I managed to solve it by creating my own Transport like that:
now using
solves the issue and
data
gets printed successfully with no issuesThe text was updated successfully, but these errors were encountered: