Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Issue 640713002: Generated FIlename different from Content Disposition string (Closed)

Created:
6 years, 2 months ago by arun87.kumar
Modified:
6 years, 1 month ago
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

This patch prevents appending extension to filename derived from content disposition if it does not have one. For example, in below case, Content-Type:text/plain;charset=UTF-8 Content-Disposition:attachment; fileName = "ABC" File is saved as "ABC" instead of "ABC.txt" BUG=411200 Committed: https://crrev.com/7252e6eb8e6e88cf7ac6f5181498d2b3fc2c3874 Cr-Commit-Position: refs/heads/master@{#301794}

Patch Set 1 #

Total comments: 1

Patch Set 2 : modified as per comments #

Total comments: 3

Patch Set 3 : Updated as per latest comments #

Total comments: 2

Patch Set 4 : Added unittests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -9 lines) Patch
M net/base/filename_util_internal.cc View 1 2 3 2 chunks +10 lines, -2 lines 0 comments Download
M net/base/filename_util_unittest.cc View 1 2 3 7 chunks +17 lines, -7 lines 0 comments Download

Messages

Total messages: 18 (2 generated)
arun87.kumar
asanka@ I have made a patch for Issue=411200. PTAL Regards, Arun
6 years, 2 months ago (2014-10-08 12:02:15 UTC) #2
asanka
https://codereview.chromium.org/640713002/diff/1/net/base/filename_util_internal.cc File net/base/filename_util_internal.cc (right): https://codereview.chromium.org/640713002/diff/1/net/base/filename_util_internal.cc#newcode283 net/base/filename_util_internal.cc:283: GenerateSafeFileName(mime_type, overwrite_extension, &result); This step isn't optional. The fact ...
6 years, 2 months ago (2014-10-08 15:58:29 UTC) #3
arun87.kumar
On 2014/10/08 15:58:29, asanka wrote: > https://codereview.chromium.org/640713002/diff/1/net/base/filename_util_internal.cc > File net/base/filename_util_internal.cc (right): > > https://codereview.chromium.org/640713002/diff/1/net/base/filename_util_internal.cc#newcode283 > ...
6 years, 2 months ago (2014-10-09 05:12:01 UTC) #4
arun87.kumar
asanka@ I have made changes according to above approach. PTAL
6 years, 2 months ago (2014-10-10 12:04:36 UTC) #5
asanka
https://codereview.chromium.org/640713002/diff/20001/net/base/filename_util_internal.cc File net/base/filename_util_internal.cc (right): https://codereview.chromium.org/640713002/diff/20001/net/base/filename_util_internal.cc#newcode283 net/base/filename_util_internal.cc:283: GenerateSafeFileName("", overwrite_extension, &result); Let's not hack around our APIs ...
6 years, 2 months ago (2014-10-10 19:52:25 UTC) #6
arun87.kumar
On 2014/10/10 19:52:25, asanka wrote: > https://codereview.chromium.org/640713002/diff/20001/net/base/filename_util_internal.cc > File net/base/filename_util_internal.cc (right): > > https://codereview.chromium.org/640713002/diff/20001/net/base/filename_util_internal.cc#newcode283 > ...
6 years, 2 months ago (2014-10-11 14:45:20 UTC) #7
arun87.kumar
asanka@ - <ping!> > Ok. How about overloading GenerateSafeFileName() by defining another method > which ...
6 years, 2 months ago (2014-10-16 17:46:06 UTC) #8
asanka
https://codereview.chromium.org/640713002/diff/20001/net/base/filename_util_internal.cc File net/base/filename_util_internal.cc (right): https://codereview.chromium.org/640713002/diff/20001/net/base/filename_util_internal.cc#newcode283 net/base/filename_util_internal.cc:283: GenerateSafeFileName("", overwrite_extension, &result); After looking at alternatives, it seems ...
6 years, 1 month ago (2014-10-23 08:21:49 UTC) #9
arun87.kumar
Updated to explicitly pass overwrite_extension as false. PTAL Regards, Arun https://codereview.chromium.org/640713002/diff/20001/net/base/filename_util_internal.cc File net/base/filename_util_internal.cc (right): https://codereview.chromium.org/640713002/diff/20001/net/base/filename_util_internal.cc#newcode283 ...
6 years, 1 month ago (2014-10-23 09:37:24 UTC) #10
asanka
Could you add tests to filename_util_unittest? https://codereview.chromium.org/640713002/diff/80001/net/base/filename_util_internal.cc File net/base/filename_util_internal.cc (right): https://codereview.chromium.org/640713002/diff/80001/net/base/filename_util_internal.cc#newcode281 net/base/filename_util_internal.cc:281: // content-disposition, if ...
6 years, 1 month ago (2014-10-23 17:58:44 UTC) #11
asanka
On 2014/10/23 17:58:44, asanka wrote: > Could you add tests to filename_util_unittest? > > https://codereview.chromium.org/640713002/diff/80001/net/base/filename_util_internal.cc ...
6 years, 1 month ago (2014-10-23 19:24:23 UTC) #12
arun87.kumar
Have added unittests and updated description PTAL https://codereview.chromium.org/640713002/diff/80001/net/base/filename_util_internal.cc File net/base/filename_util_internal.cc (right): https://codereview.chromium.org/640713002/diff/80001/net/base/filename_util_internal.cc#newcode281 net/base/filename_util_internal.cc:281: // content-disposition, ...
6 years, 1 month ago (2014-10-28 11:43:55 UTC) #13
asanka
lgtm
6 years, 1 month ago (2014-10-28 21:18:02 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/640713002/100001
6 years, 1 month ago (2014-10-29 04:58:46 UTC) #16
commit-bot: I haz the power
Committed patchset #4 (id:100001)
6 years, 1 month ago (2014-10-29 06:19:10 UTC) #17
commit-bot: I haz the power
6 years, 1 month ago (2014-10-29 06:19:56 UTC) #18
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/7252e6eb8e6e88cf7ac6f5181498d2b3fc2c3874
Cr-Commit-Position: refs/heads/master@{#301794}

Powered by Google App Engine
This is Rietveld 408576698