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 opening office documents from webdav network mounts on windows #16739

Merged
merged 1 commit into from
Aug 14, 2019

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Aug 14, 2019

I tried to debug opening office documents from a webdav mounted drive on windows a bit, which prompt for credentials when opening files that are not located in the root folder. This PR at fixes the issue with Windows 10 and current Office 365.

Related previous fix #12556

The following requests happen without that patch applied and

Access log when opening a file in office

/test.docx (works)

[14/Aug/2019:08:25:36 +0200] "GET /remote.php/webdav/Test.docx HTTP/2.0" 304 46 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"

[14/Aug/2019:08:25:36 +0200] "OPTIONS /remote.php/ HTTP/1.1" 404 9468 "-" "Microsoft Office Word 2014"
[14/Aug/2019:08:25:36 +0200] "OPTIONS /remote.php/ HTTP/1.1" 404 9460 "-" "Microsoft Office Word 2014"

[14/Aug/2019:08:25:37 +0200] "LOCK /remote.php/webdav/Test.docx HTTP/2.0" 200 643 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:37 +0200] "PROPFIND /remote.php/webdav/~%24Test.docx HTTP/2.0" 404 275 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:37 +0200] "PUT /remote.php/webdav/~%24Test.docx HTTP/2.0" 201 113 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:37 +0200] "LOCK /remote.php/webdav/~%24Test.docx HTTP/2.0" 200 622 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:37 +0200] "HEAD /remote.php/webdav/~%24Test.docx HTTP/2.0" 401 35 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:37 +0200] "HEAD /remote.php/webdav/~%24Test.docx HTTP/2.0" 200 89 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:37 +0200] "PUT /remote.php/webdav/~%24Test.docx HTTP/2.0" 204 64 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:38 +0200] "PROPPATCH /remote.php/webdav/~%24Test.docx HTTP/2.0" 207 632 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:38 +0200] "UNLOCK /remote.php/webdav/~%24Test.docx HTTP/2.0" 204 33 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:38 +0200] "PROPFIND /remote.php/webdav/~%24Test.docx HTTP/2.0" 207 662 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:38 +0200] "DELETE /remote.php/webdav/~%24Test.docx HTTP/2.0" 204 33 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:25:38 +0200] "UNLOCK /remote.php/webdav/Test.docx HTTP/2.0" 204 33 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"

/Demo/test.docx (doesn't work)

[14/Aug/2019:08:24:54 +0200] "PROPFIND /remote.php/webdav/Documents/desktop.ini HTTP/2.0" 404 662 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:24:54 +0200] "PROPFIND /remote.php/webdav HTTP/2.0" 207 641 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:24:55 +0200] "PROPFIND /remote.php/webdav/Documents HTTP/2.0" 207 649 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:24:55 +0200] "PROPFIND /remote.php/webdav/Documents/Test.docx HTTP/2.0" 207 670 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:24:55 +0200] "PROPFIND /remote.php/webdav/Documents/Test.docx HTTP/2.0" 207 670 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"
[14/Aug/2019:08:24:55 +0200] "GET /remote.php/webdav/Documents/Test.docx HTTP/2.0" 200 12106 "-" "Microsoft-WebDAV-MiniRedir/10.0.17763"

[14/Aug/2019:08:24:56 +0200] "OPTIONS /remote.php/webdav/ HTTP/1.1" 401 6666 "-" "Microsoft Office Word 2014"
[14/Aug/2019:08:24:56 +0200] "OPTIONS /remote.php/webdav/ HTTP/1.1" 401 6662 "-" "Microsoft Office Word 2014"

Office sends OPTIONS/HEAD requests before opening the document with an "Authorization: Bearer" header without a token, which causes an unauthorized response, which when checking for that seems to fix the ever showing credentials dialog. However I still don't get why the request for the file in the root would go to /remote.php/ and works because a 404 is returned 🤷‍♀️

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm.... sure...

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

Successfully merging this pull request may close these issues.

3 participants