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

Fix: use Depth = 1 for PROPFIND, fixes connecting to Hetzner #4608

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

esteve
Copy link

@esteve esteve commented Nov 3, 2024

I noticed that I couldn't connect to my Hetzner storage box via webdav, as it does not allow PROPFIND requests without Depth set as 0 or 1. When a request is created via NewRequest it doesn't have a Depth field, which Hetzner interprets as infinity:

$ curl -X PROPFIND https://XXXX:XXXXX@XXXXXXXXX/webdav/
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>PROPFIND requests with a Depth of "infinity" are not allowed for /webdav/.</p>
</body></html>

I believe this is the same issue as #4074 #3541

I've tested the change locally and it works. However photoprism still uses PROPFIND with Depth = infinity somehwere else, I'd suspect it's because of

subDirs, err := client.Directories(a.SyncPath, true, webdav.MaxRequestDuration)
, but this is the first Go code I've ever written and I'm not familiar with the http and webdav packages.

Signed-off-by: Esteve Fernandez <esteve@apache.org>
@CLAassistant
Copy link

CLAassistant commented Nov 3, 2024

CLA assistant check
All committers have signed the CLA.

@esteve esteve marked this pull request as ready for review November 3, 2024 16:07
@gOOvER
Copy link

gOOvER commented Nov 10, 2024

i have the same problem with hetzner and i would be happy, when this could be merged asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants