-
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
Remove Hardcoded MimeTypes from the sharing functions #34087
Conversation
@@ -394,7 +394,8 @@ public function checkLastPublicSharedFileDownload() { | |||
$url = $this->lastShareData->data->url; | |||
} | |||
$fullUrl = "$url/download"; | |||
$this->checkDownload($fullUrl, null, null, 'text/plain'); | |||
$mimeType = \json_decode(\json_encode($this->lastShareData->data->mimetype), 1)[0]; |
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.
We could put this "magic" into a method with a name like getMimeTypeOfLastShare
6a41000
to
9b901a1
Compare
Codecov Report
@@ Coverage Diff @@
## master #34087 +/- ##
============================================
+ Coverage 64.76% 64.77% +<.01%
Complexity 18345 18345
============================================
Files 1198 1198
Lines 69425 69425
Branches 1276 1276
============================================
+ Hits 44965 44969 +4
+ Misses 24091 24087 -4
Partials 369 369
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #34087 +/- ##
=========================================
Coverage 64.77% 64.77%
Complexity 18345 18345
=========================================
Files 1198 1198
Lines 69425 69425
Branches 1276 1276
=========================================
Hits 44969 44969
Misses 24087 24087
Partials 369 369
Continue to review full report at Codecov.
|
9b901a1
to
03b8e10
Compare
Backport on #34095 |
Description
In Sharing functions the last shared file's mimeType were checked with hardcoded
text/plain
which was not very flexible for sharing files other than text.Removed that to check mimeType from last Shared data.
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: