diff options
author | dtapuska <dtapuska@chromium.org> | 2015-04-30 07:12:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-30 14:12:32 +0000 |
commit | 122d485f173d2b4ca7ed36b64e9d4bd57197299f (patch) | |
tree | a0458fcb9d293a56bd3f552da2fd0d2dcab2e705 /net/http/http_content_disposition_unittest.cc | |
parent | cfe784c140b97cb3566e59abe4c2b5b2e2b26ef5 (diff) | |
download | chromium_src-122d485f173d2b4ca7ed36b64e9d4bd57197299f.zip chromium_src-122d485f173d2b4ca7ed36b64e9d4bd57197299f.tar.gz chromium_src-122d485f173d2b4ca7ed36b64e9d4bd57197299f.tar.bz2 |
Remove support for "name" parameter from Content-Disposition.
All other UAs don't treat the name value as a synonym. Drop support
from Chrome.
UMA metrics indicate 0.00% actually only contain the "name" attribute.
0.01% of requests had with a name attribute; but had higher preference
values as well. This feature isn't clearly used anymore.
BUG=162815
TEST=net_unittests
Review URL: https://codereview.chromium.org/1107913003
Cr-Commit-Position: refs/heads/master@{#327708}
Diffstat (limited to 'net/http/http_content_disposition_unittest.cc')
-rw-r--r-- | net/http/http_content_disposition_unittest.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/net/http/http_content_disposition_unittest.cc b/net/http/http_content_disposition_unittest.cc index ade0d29..d3e4c33 100644 --- a/net/http/http_content_disposition_unittest.cc +++ b/net/http/http_content_disposition_unittest.cc @@ -23,9 +23,7 @@ TEST(HttpContentDispositionTest, Filename) { const FileNameCDCase tests[] = { // Test various forms of C-D header fields emitted by web servers. {"inline; filename=\"abcde.pdf\"", "", L"abcde.pdf"}, - {"inline; name=\"abcde.pdf\"", "", L"abcde.pdf"}, {"attachment; filename=abcde.pdf", "", L"abcde.pdf"}, - {"attachment; name=abcde.pdf", "", L"abcde.pdf"}, {"attachment; filename=abc,de.pdf", "", L"abc,de.pdf"}, {"filename=abcde.pdf", "", L"abcde.pdf"}, {"filename= abcde.pdf", "", L"abcde.pdf"}, @@ -33,9 +31,12 @@ TEST(HttpContentDispositionTest, Filename) { {"filename = abcde.pdf", "", L"abcde.pdf"}, {"filename\t=abcde.pdf", "", L"abcde.pdf"}, {"filename \t\t =abcde.pdf", "", L"abcde.pdf"}, - {"name=abcde.pdf", "", L"abcde.pdf"}, {"inline; filename=\"abc%20de.pdf\"", "", L"abc de.pdf"}, + // Name values are no longer synonyms for filename. + {"inline; name=\"abcde.pdf\"", "", L""}, + {"attachment; name=abcde.pdf", "", L""}, + {"name=abcde.pdf", "", L""}, // Unbalanced quotation mark {"filename=\"abcdef.pdf", "", L"abcdef.pdf"}, // Whitespaces are converted to a space. @@ -315,10 +316,11 @@ TEST(HttpContentDispositionTest, tc2231) { L"foo-A.html" // Should be L"foo-%41.html" }, // http://greenbytes.de/tech/tc2231/#attwithnamepct + // Value is skipped like other UAs. { "attachment; name=\"foo-%41.html\"", HttpContentDisposition::ATTACHMENT, - L"foo-A.html" // Should be L"foo-%41.html" + L"" }, #ifdef ICU_SHOULD_FAIL_CONVERSION_ON_INVALID_CHARACTER // http://greenbytes.de/tech/tc2231/#attwithfilenamepctandiso @@ -479,12 +481,10 @@ TEST(HttpContentDispositionTest, ParseResult) { HttpContentDisposition::HAS_FILENAME }, { "attachment; filename=x; name=y", HttpContentDisposition::HAS_DISPOSITION_TYPE | - HttpContentDisposition::HAS_FILENAME | - HttpContentDisposition::HAS_NAME }, + HttpContentDisposition::HAS_FILENAME }, { "attachment; name=y; filename*=utf-8''foo; name=x", HttpContentDisposition::HAS_DISPOSITION_TYPE | - HttpContentDisposition::HAS_EXT_FILENAME | - HttpContentDisposition::HAS_NAME }, + HttpContentDisposition::HAS_EXT_FILENAME }, // Feature tests for 'filename' attribute. { "filename=foo\xcc\x88", @@ -500,13 +500,13 @@ TEST(HttpContentDispositionTest, ParseResult) { HttpContentDisposition::HAS_FILENAME | HttpContentDisposition::HAS_RFC2047_ENCODED_STRINGS }, { "filename==?utf-8?Q?foo?", HttpContentDisposition::INVALID }, - { "name=foo\xcc\x88", - HttpContentDisposition::HAS_NAME }, + + // Test 'name' isn't a synonym for 'filename'. + { "name=foo\xcc\x88", HttpContentDisposition::INVALID }, // Shouldn't set |has_non_ascii_strings| based on 'name' attribute. { "filename=x; name=foo\xcc\x88", - HttpContentDisposition::HAS_FILENAME | - HttpContentDisposition::HAS_NAME }, + HttpContentDisposition::HAS_FILENAME }, { "filename=foo\xcc\x88 foo%cc%88 =?utf-8?Q?foo?=", HttpContentDisposition::HAS_FILENAME | HttpContentDisposition::HAS_NON_ASCII_STRINGS | @@ -517,7 +517,7 @@ TEST(HttpContentDispositionTest, ParseResult) { { "filename=foo\xcc\x88 foo%cc%88 =?utf-8?Q?foo?", HttpContentDisposition::INVALID }, { "filename=foo\xcc\x88 foo%cc%88 =?utf-8?Q?foo?; name=x", - HttpContentDisposition::HAS_NAME }, + HttpContentDisposition::INVALID }, }; for (size_t i = 0; i < arraysize(kTestCases); ++i) { |