New issue
Advanced search Search tips

Issue 908176 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

WebApkShareTargetUtil#computeMultipartPostData() incorrectly filters shared files

Project Member Reported by pkotw...@chromium.org, Nov 23

Issue description

MimeTypeFilter#accept() takes two values as parameters:
uri and mimeType
- The file extension (e.g. .png) is extracted from the URI and is used for filtering
- The mimeType is used as is

WebApkShareTargetUtil#computeMultipartPostData() currently passes the content URI as the uri parameter to MimeTypeFilter#accept()

The content URI usually does not have a file extension
The share data name, extracted via WebApkShareTargetUtil#getFileNameFromContentUri() sometimes has a file extension

If the file name is available, we should pass the file name instead of the content URI to MimeTypeFilter#accept()

 
I suggest making the return value of WebApkShareTargetUtil#getFileNameFromContentUri() a URI by prepending a scheme

e.g. "sharetargetname://" + WebApkShareTargetUtil#getFileNameFromContentUri()
Owner: pkotw...@chromium.org
Status: Assigned (was: Untriaged)
This issue has an owner, a component and a priority, but is still listed as untriaged or unconfirmed. By definition, this bug is triaged. Changing status to "assigned". Please reach out to me if you disagree with how I've done this.

Sign in to add a comment