| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/base/net_util.h" | 5 #include "net/base/net_util.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1851 L"evil" | 1851 L"evil" |
| 1852 }, | 1852 }, |
| 1853 // Test truncation of trailing dots and spaces | 1853 // Test truncation of trailing dots and spaces |
| 1854 { | 1854 { |
| 1855 "http://www.goodguy.com/evil.exe ", | 1855 "http://www.goodguy.com/evil.exe ", |
| 1856 "Content-Dispostion: filename=evil.exe ", | 1856 "Content-Dispostion: filename=evil.exe ", |
| 1857 "", | 1857 "", |
| 1858 "", | 1858 "", |
| 1859 "binary/octet-stream", | 1859 "binary/octet-stream", |
| 1860 L"download", | 1860 L"download", |
| 1861 L"evil.exe" | 1861 L"evil.exe-" |
| 1862 }, | 1862 }, |
| 1863 { | 1863 { |
| 1864 "http://www.goodguy.com/evil.exe.", | 1864 "http://www.goodguy.com/evil.exe.", |
| 1865 "Content-Dispostion: filename=evil.exe.", | 1865 "Content-Dispostion: filename=evil.exe.", |
| 1866 "", | 1866 "", |
| 1867 "", | 1867 "", |
| 1868 "binary/octet-stream", | 1868 "binary/octet-stream", |
| 1869 L"download", | 1869 L"download", |
| 1870 L"evil.exe" | 1870 L"evil.exe-" |
| 1871 }, | 1871 }, |
| 1872 { | 1872 { |
| 1873 "http://www.goodguy.com/evil.exe. . .", | 1873 "http://www.goodguy.com/evil.exe. . .", |
| 1874 "Content-Dispostion: filename=evil.exe. . .", | 1874 "Content-Dispostion: filename=evil.exe. . .", |
| 1875 "", | 1875 "", |
| 1876 "", | 1876 "", |
| 1877 "binary/octet-stream", | 1877 "binary/octet-stream", |
| 1878 L"download", | 1878 L"download", |
| 1879 L"evil.exe" | 1879 L"evil.exe-------" |
| 1880 }, | 1880 }, |
| 1881 { | 1881 { |
| 1882 "http://www.goodguy.com/evil.", | 1882 "http://www.goodguy.com/evil.", |
| 1883 "Content-Dispostion: filename=evil.", | 1883 "Content-Dispostion: filename=evil.", |
| 1884 "", | 1884 "", |
| 1885 "", | 1885 "", |
| 1886 "binary/octet-stream", | 1886 "binary/octet-stream", |
| 1887 L"download", | 1887 L"download", |
| 1888 L"evil" | 1888 L"evil-" |
| 1889 }, | 1889 }, |
| 1890 { | 1890 { |
| 1891 "http://www.goodguy.com/. . . . .", | 1891 "http://www.goodguy.com/. . . . .", |
| 1892 "Content-Dispostion: filename=. . . . .", | 1892 "Content-Dispostion: filename=. . . . .", |
| 1893 "", | 1893 "", |
| 1894 "", | 1894 "", |
| 1895 "binary/octet-stream", | 1895 "binary/octet-stream", |
| 1896 L"download", | 1896 L"download", |
| 1897 L"download" | 1897 L"download" |
| 1898 }, | 1898 }, |
| 1899 { |
| 1900 "http://www.badguy.com/attachment?name=meh.exe%C2%A0", |
| 1901 "attachment; filename=\"meh.exe\xC2\xA0\"", |
| 1902 "", |
| 1903 "", |
| 1904 "binary/octet-stream", |
| 1905 L"", |
| 1906 L"meh.exe-" |
| 1907 }, |
| 1899 #endif // OS_WIN | 1908 #endif // OS_WIN |
| 1900 { | 1909 { |
| 1901 "http://www.goodguy.com/utils.js", | 1910 "http://www.goodguy.com/utils.js", |
| 1902 "Content-Dispostion: filename=utils.js", | 1911 "Content-Dispostion: filename=utils.js", |
| 1903 "", | 1912 "", |
| 1904 "", | 1913 "", |
| 1905 "application/x-javascript", | 1914 "application/x-javascript", |
| 1906 L"download", | 1915 L"download", |
| 1907 L"utils.js" | 1916 L"utils.js" |
| 1908 }, | 1917 }, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1987 L"download", | 1996 L"download", |
| 1988 L"hidden" TXT_EXT | 1997 L"hidden" TXT_EXT |
| 1989 }, | 1998 }, |
| 1990 { | 1999 { |
| 1991 "http://www.evil.com/trailing.", | 2000 "http://www.evil.com/trailing.", |
| 1992 "Content-Disposition: filename=trailing.", | 2001 "Content-Disposition: filename=trailing.", |
| 1993 "", | 2002 "", |
| 1994 "", | 2003 "", |
| 1995 "dance/party", | 2004 "dance/party", |
| 1996 L"download", | 2005 L"download", |
| 2006 #if defined(OS_WIN) |
| 2007 L"trailing-" |
| 2008 #else |
| 1997 L"trailing" | 2009 L"trailing" |
| 2010 #endif //OS_WIN |
| 1998 }, | 2011 }, |
| 1999 { | 2012 { |
| 2000 "http://www.evil.com/trailing.", | 2013 "http://www.evil.com/trailing.", |
| 2001 "Content-Disposition: filename=trailing.", | 2014 "Content-Disposition: filename=trailing.", |
| 2002 "", | 2015 "", |
| 2003 "", | 2016 "", |
| 2004 "text/plain", | 2017 "text/plain", |
| 2005 L"download", | 2018 L"download", |
| 2019 #if defined(OS_WIN) |
| 2020 L"trailing-" TXT_EXT |
| 2021 #else |
| 2006 L"trailing" TXT_EXT | 2022 L"trailing" TXT_EXT |
| 2023 #endif //OS_WIN |
| 2007 }, | 2024 }, |
| 2008 { | 2025 { |
| 2009 "http://www.evil.com/.", | 2026 "http://www.evil.com/.", |
| 2010 "Content-Dispostion: filename=.", | 2027 "Content-Dispostion: filename=.", |
| 2011 "", | 2028 "", |
| 2012 "", | 2029 "", |
| 2013 "dance/party", | 2030 "dance/party", |
| 2014 L"download", | 2031 L"download", |
| 2015 L"download" | 2032 L"download" |
| 2016 }, | 2033 }, |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3394 if (it->address[i] != 0) { | 3411 if (it->address[i] != 0) { |
| 3395 all_zeroes = false; | 3412 all_zeroes = false; |
| 3396 break; | 3413 break; |
| 3397 } | 3414 } |
| 3398 } | 3415 } |
| 3399 EXPECT_FALSE(all_zeroes); | 3416 EXPECT_FALSE(all_zeroes); |
| 3400 } | 3417 } |
| 3401 } | 3418 } |
| 3402 | 3419 |
| 3403 } // namespace net | 3420 } // namespace net |
| OLD | NEW |