WebDAV: Add depth header to service discovery request for Hetzner compatibility#4608
Conversation
Signed-off-by: Esteve Fernandez <esteve@apache.org>
|
i have the same problem with hetzner and i would be happy, when this could be merged asap |
|
Thank you so much for submitting this PR! My apologies for not getting back to you sooner. I've been helping our team with the frontend update, which is now complete, so I can finally check the open PRs and merge them :) |
|
@esteve The above changes allow you to set custom request headers in the service type configuration, rather than adding a However, you are right that this may not be enough for you to use the service, since our WebDAV client currently only makes a single, recursive request to get a list of files and folders on the remote server:
This could be solved by implementing a fallback that makes multiple requests to get the contents of the remote folders for synchronization; for example, you could implement the Directories() function differently and use it when certain errors are detected in line 148 (see the source code of earlier releases for inspiration): photoprism/internal/service/webdav/client.go Lines 142 to 165 in c096382 |
|
This can now be tested with our development preview build: |
|
@lastzero thank you for merging this PR π |
I noticed that I couldn't connect to my Hetzner storage box via webdav, as it does not allow
PROPFINDrequests withoutDepthset as0or1. When a request is created viaNewRequestit doesn't have aDepthfield, which Hetzner interprets asinfinity:I believe this is the same issue as #4074 #3541
I've tested the change locally and it works. However photoprism still uses
PROPFINDwithDepth = infinitysomehwere else, I'd suspect it's because ofphotoprism/internal/workers/sync_refresh.go
Line 28 in c096382
httpandwebdavpackages.