-
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
Do not load previews for unsupported mimes #27558
Conversation
I'd skip loading unsupported previews completely but I haven't found a way to grab all available mimetypes at once yet :/ another option is to extend DAV response with But Trashbin is still using old non-dav endpoint (what about other apps(?)) cc @PVince81 |
I think just returning 204 should be enough. Now I wonder if mobile clients might break with this... @davivel If yes, then let's add a special header or query param that only the web UI gives to get that 204 response. |
ok, reverting my local miserable attempts to pass supported mimes via |
404 is the status if a resource is not found. This is the correct behaviour in this case. 👎 |
In this case the only solution I can think of is to pass the list of supported previews through config.php or other means (like the mimetype JS thing) and prevent the client to request the preview URLs when it is known to not have previews. That or send back the icon instead of a preview. But this could break the expectation of mobile client. |
👍 this is the way it is already supposed to work |
@DeepDiver1975 it doesn't, because the web UI currently has no idea what preview types are supported. There used to be an attribute Well, we could maybe add that attribute in Webdav and call it "oc:preview-url". If set, the web UI uses it to fetch the preview. If not set, fetch the icon instead. |
f5383ee
to
9e9c3e9
Compare
@DeepDiver1975 @PVince81 oook... Finally I've found how to make this lazy-registered stuff less lazy. |
core/ajax/preview.php
Outdated
@@ -51,7 +51,7 @@ | |||
$info = \OC\Files\Filesystem::getFileInfo($file); | |||
|
|||
if (!$info instanceof OCP\Files\FileInfo || !$always && !\OC::$server->getPreviewManager()->isAvailable($info)) { | |||
\OC_Response::setStatus(404); | |||
\OC_Response::setStatus(204); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert
Tested, works. However you need to revert the error code to 404. |
9e9c3e9
to
c6d6fca
Compare
@PVince81 reverted |
👍 Let's hope you don't need to massage Jenkins again |
c6d6fca
to
45aef4d
Compare
@PVince81 Tests passed |
@VicDeo @PVince81 @DeepDiver1975 Excellent work! 👍 |
Regression #27932 |
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. |
Description
- As suggested, set response to 204 instead of 404 if there is no previewoc_appconfig.core.enabledPreviewProviders
and test mime against this list on js side.Related Issue
Fixes #24216
Motivation and Context
#24216 (comment)
Types of changes