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

Remove Hardcoded MimeTypes from the sharing functions #34087

Merged
merged 1 commit into from
Jan 9, 2019

Conversation

dpakach
Copy link
Contributor

@dpakach dpakach commented Jan 9, 2019

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@@ -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];
Copy link
Contributor

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

@codecov
Copy link

codecov bot commented Jan 9, 2019

Codecov Report

Merging #34087 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             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
Flag Coverage Δ Complexity Δ
#javascript 53.09% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.12% <ø> (ø) 18345 <ø> (ø) ⬇️
Impacted Files Coverage Δ Complexity Δ
lib/private/Files/View.php 84.6% <0%> (+0.3%) 398% <0%> (ø) ⬇️
lib/private/DB/Connection.php 66.17% <0%> (+0.73%) 49% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 693f45b...9b901a1. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 9, 2019

Codecov Report

Merging #34087 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            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
Flag Coverage Δ Complexity Δ
#javascript 53.09% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.12% <ø> (ø) 18345 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 693f45b...03b8e10. Read the comment docs.

@phil-davis phil-davis merged commit 81e523a into master Jan 9, 2019
@delete-merged-branch delete-merged-branch bot deleted the remove-hardcoded-mimetypes branch January 9, 2019 11:27
@dpakach
Copy link
Contributor Author

dpakach commented Jan 9, 2019

Backport on #34095

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API acceptance tests - do not only check hard-coded mime type
2 participants