-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Revert for files app to use ajax download instead of Webdav #23521
Conversation
This is required to be able to show a correct HTML error page in case of error. Webdav only returns XML.
@karlitschek backport to stable9 ? Without this the user would see an XML response in case or an error page (ex: firewall) |
is that really of an issue? |
@DeepDiver1975 it's not user-friendly to dump XML content instead of an error page instead of a nice message "You cannot download this file because it was blocked" or "Cannot decrypt this file", etc. Unfortunately there isn't much that can be done directly. One would need to pre-download the file with $.ajax to see if there's an error and if there is not, redirect to the link. Ugly. |
What about doing a HEAD request first and if statuscode !== 200 then redirect to some kind of error page? |
Hmmm, interesting. That could work, assuming that HEAD will also fail for encryption, firewall and other possible errors. Tbh I'm not willing to experiment too much given the remaining short time for 9.0.1, the ajax/download.php isn't that bad considering that we also use it for folder downloads. I'm happy to do more experimentation for 9.1 (HEAD or provide a Sabre HTML rendered like the BrowserPlugin) |
I'll still have a quick try with HEAD because you picked my curiosity 😉 |
If we really want a fancy web page displayed we can add a plugin which will convert the exception into a proper page for Browsers. |
Yeah, I think in the end I'd also prefer the Sabre plugin approach, because we'll need it again with the future zip download endpoint, where a HEAD request cannot predict fully whether the request can succeed (ex: locked files, etc) |
I can take care about this later today if you want ... |
@DeepDiver1975 you're welcome to wield the Sabre today 😄 Maybe the official BrowserPlugin can be used as inspiration. |
From what I get the browser plugin magic is there => Close. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is required to be able to show a correct HTML error page in case
of error. Webdav only returns XML.
Fixes #23500
@DeepDiver1975 @oparoz @SergioBertolinSG @icewind1991 @rullzer @nickvergessen