summaryrefslogtreecommitdiffstats
path: root/net/http/http_response_headers_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Change most uses of Pickle to base::Picklebrettw2015-06-031-2/+2
| | | | | | | | | | There should be no behavior change. TBR=jschuh (IPC messages) Review URL: https://codereview.chromium.org/1154283003 Cr-Commit-Position: refs/heads/master@{#332552}
* net cleanup: Remove unnecessary namespace prefixes.ttuttle2015-04-231-403/+340
| | | | | | | | BUG=475208 Review URL: https://codereview.chromium.org/1095823003 Cr-Commit-Position: refs/heads/master@{#326610}
* Refactor NetLog::LogLevel --> NetLogCaptureMode.eroman2015-04-231-2/+2
| | | | | | | | | | | | | This is both a rename, and a functional change. Before LogLevel was an enum, and consumers would compare its numeric value, or use it for serialization purposes. Whereas NetLogCaptureMode is a class that encapsulates the various capabilities for a logging level. BUG=472710 TBR=asanka@chromium.org,sergeyu@chromium.org,yurys@chromium.org,bengr@chromium.org,asargent@chromium.org,zea@chromium.org,scherkus@chromium.org Review URL: https://codereview.chromium.org/1059843002 Cr-Commit-Position: refs/heads/master@{#326440}
* Remove deprecated methods from Pickle.avi2014-12-281-1/+1
| | | | | | | | | | | | | BUG=444578 TEST=none R=nasko@chromium.org TBR=ben@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/b740bfe23ae7ad244356a4a7538b95ae560251db Review URL: https://codereview.chromium.org/818833004 Cr-Commit-Position: refs/heads/master@{#309691}
* Revert of Remove deprecated methods from Pickle. (patchset #10 id:180001 of ↵avi2014-12-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/818833004/) Reason for revert: Allegedly causes a performance hit: http://crbug.com/445173 Original issue's description: > Remove deprecated methods from Pickle. > > BUG=444578 > TEST=none > R=nasko@chromium.org > TBR=ben@chromium.org > > Committed: https://chromium.googlesource.com/chromium/src/+/b740bfe23ae7ad244356a4a7538b95ae560251db TBR=nasko@chromium.org NOTREECHECKS=true NOTRY=true BUG=444578 Review URL: https://codereview.chromium.org/825353003 Cr-Commit-Position: refs/heads/master@{#309689}
* Remove deprecated methods from Pickle.Avi Drissman2014-12-221-1/+1
| | | | | | | | | | | BUG=444578 TEST=none R=nasko@chromium.org TBR=ben@chromium.org Review URL: https://codereview.chromium.org/818833004 Cr-Commit-Position: refs/heads/master@{#309445}
* Make HRH::IsKeepAlive() look past the first headerricea2014-10-171-0/+85
| | | | | | | | | | | | | | | | | Up until now, HttpResponseHeaders::IsKeepAlive() only looked at the first value of the Connection header. Since for a WebSocket response a header like Connection: Upgrade, close is valid we should check other values past the first value. BUG=371759 TEST=net_unittests Review URL: https://codereview.chromium.org/640213002 Cr-Commit-Position: refs/heads/master@{#300087}
* stale-while-revalidate experimental implementation.ricea2014-10-081-24/+82
| | | | | | | | | | | | | | | | | | | | | Simplistic implementation of stale-while-revalidate. See design doc at https://docs.google.com/document/d/1DMCIMAKjyKeYiu69jlI5OsO2pGyAMb81XflYK4hxsNM/edit?usp=sharing This implementation has known flaws: 1. Set-Cookie, Strict-Transport-Security and Public-Key-Pins headers are lost from the responses of asynchronous revalidations. 2. Conditional requests sent from the Blink cache do not have the stale-while-revalidate logic applied to them. 3. Support for the bandwidth reduction proxy is hacky. It will be replaced with a better implementation if/when the concept is proven. BUG=348877 TEST=net_unittests Review URL: https://codereview.chromium.org/455623003 Cr-Commit-Position: refs/heads/master@{#298649}
* Remove implicit conversions from scoped_refptr to T* in net/http/dcheng2014-08-261-2/+2
| | | | | | | | | | | This patch was generated by running the rewrite_scoped_refptr clang tool on a Linux build. BUG=110610 Review URL: https://codereview.chromium.org/502163003 Cr-Commit-Position: refs/heads/master@{#291815}
* parameterize http response header testsmostynb@opera.com2014-08-211-1485/+1654
| | | | | | | | | | | | | | | | Followup to https://codereview.chromium.org/391763002 to allow this to build on more compilers (which can fail when using structs defined in funtions in arraysize calls- as mentioned in base/macros.h). By refactoring to use TEST_P we can skip the manual loop entirely. BUG=348877 TEST=net_unittests --gtest_filter=Http* Review URL: https://codereview.chromium.org/448373003 Cr-Commit-Position: refs/heads/master@{#291025} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291025 0039d316-1c4b-4281-b951-d872f2087c98
* Initial implementation of Chrome-Freshness header.ricea@chromium.org2014-07-301-0/+150
| | | | | | | | | | | | | | | | | | Add a header like Chrome-Freshness: max-age=30,stale-while-revalidate=60,age=10 when sending a revalidation request to a server which supplied the Cache-Control stale-while-revalidate directive on the previous response. Design doc: https://docs.google.com/document/d/1DMCIMAKjyKeYiu69jlI5OsO2pGyAMb81XflYK4hxsNM/edit BUG=348877 TEST=net_unittests Review URL: https://codereview.chromium.org/391763002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286482 0039d316-1c4b-4281-b951-d872f2087c98
* Moved data reduction proxy header processing out of netbengr@chromium.org2014-06-151-333/+0
| | | | | | | | BUG=367221 Review URL: https://codereview.chromium.org/318753005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277314 0039d316-1c4b-4281-b951-d872f2087c98
* Update UMA to track bypasses due to 4xx responses that are missing the ↵bengr@chromium.org2014-05-301-0/+11
| | | | | | | | | | proxy's via header and bypasses due to network errors. BUG=376148 Review URL: https://codereview.chromium.org/298883011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273839 0039d316-1c4b-4281-b951-d872f2087c98
* Collect data reduction proxy UMA on all platformsbengr@chromium.org2014-05-111-0/+2
| | | | | | | | | | | | | | UMA for the data reduction proxy was gated behind preprocessor directives that resticted the logic to Android and iOS. This change opens UMA calculations and collection up to all platforms. BUG=369619 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269026 Review URL: https://codereview.chromium.org/266033002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269670 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for 308 permanent redirects.mmenke@chromium.org2014-04-241-0/+5
| | | | | | | | | | | | | | See https://datatracker.ietf.org/doc/draft-reschke-http-status-308/ This should not break 308 Resume Incomplete responses, since they don't have Location headers. R=willchan@chromium.org BUG=109012 Review URL: https://codereview.chromium.org/9816011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265835 0039d316-1c4b-4281-b951-d872f2087c98
* Moved data reduction proxy chrome code to componentbengr@chromium.org2014-04-141-9/+9
| | | | | | | | | | | | | | | | | | | | | Platform-inspecific code was moved from chrome/browser/net/spdyproxy to components/data_reduction_proxy. Names that include variations on SpdyProxyAuth have been changed to DataReductionProxy. Significant changes include: (1) InitChromeProxySettings now takes |PrefService|s and a URLRequestContextGetter. (2) All switches and prefs have been moved to components/data_reduction_proxy/common. (3) data_reduction_proxy_settings_unittest.[cc,h] was split into itself and data_reduction_proxy_settings_test_util.[cc,h]. (4) proxy configuration via prefs is embedded. BUG=359340 Review URL: https://codereview.chromium.org/214343003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263728 0039d316-1c4b-4281-b951-d872f2087c98
* Fix UMA reporting of data reduction proxy bypass reasonsbengr@chromium.org2014-03-311-0/+77
| | | | | | | | | | 5xx responses from the proxy that should induce proxy bypass were previously reported as bypassing due to a missing via header value, because such responses often also are missing that header value. This change fixes that reporting. BUG=356445 Review URL: https://codereview.chromium.org/212873004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260598 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: have common HttpResponseHeaders routine to update with rangekinuko@chromium.org2014-03-101-0/+53
| | | | | | | | | | | | | | Currently we do this header-fixup in two places: PartialData and AppCache, and I'm planning to do the very same header-fixup in yet another module, ServiceWorker. I want to have a common utility in net/http/http_util to do this so that all 3 modules can share it. BUG=349319 TEST=HttpResponseHeadersTest.UpdateWithNewRange Review URL: https://codereview.chromium.org/187583002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255905 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed chrome proxy via checkbengr@chromium.org2014-03-061-0/+4
| | | | | | | | | | | This prevents a crash when a token on the via header is fewer than four characters. BUG=349020 Review URL: https://codereview.chromium.org/187273002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255274 0039d316-1c4b-4281-b951-d872f2087c98
* Support for new data reduction proxy via headerbengr@chromium.org2014-02-141-0/+70
| | | | | | | | | | | | This new header conforms to RFC 2616. With this change, both the old and new header will be supported. Eventually, support for the old header will be removed. BUG=340333 Review URL: https://codereview.chromium.org/156373002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251256 0039d316-1c4b-4281-b951-d872f2087c98
* Added tests for ProxyList::UpdateRetryInfoOnFallbackbengr@chromium.org2013-12-191-0/+16
| | | | | | | | | | | | This CL addresses comments made by eroman@ in https://codereview.chromium.org/98373005/. In particular, additional test coverage is included. BUG=325333 Review URL: https://codereview.chromium.org/117333004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241789 0039d316-1c4b-4281-b951-d872f2087c98
* Accept Chrome-Proxy: block=xxx to bypass all Chrome proxiesbengr@chromium.org2013-12-131-27/+55
| | | | | | | | BUG=325333 Review URL: https://codereview.chromium.org/98373005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240737 0039d316-1c4b-4281-b951-d872f2087c98
* Added support for a new HTTP response header called Chrome-Proxy, which is ↵bengr@chromium.org2013-10-281-0/+125
| | | | | | | | | | restricted to only the data compression proxy. The header carries a comma-separated list of instructions for proxy/Chrome interaction. This change introduces one instruction, "bypass," which specifies a number of seconds that Chrome should bypass the proxy. BUG=306631 Review URL: https://codereview.chromium.org/26515005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231404 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of time headers in net/, part 2.avi@chromium.org2013-06-281-1/+1
| | | | | | | | | | BUG=254986 TEST=none TBR=ben@chromium.org Review URL: https://codereview.chromium.org/18054010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209150 0039d316-1c4b-4281-b951-d872f2087c98
* Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*"rsleevi@chromium.org2013-06-011-1/+1
| | | | | | | | | | | Linux fixes BUG=110610 TBR=darin Review URL: https://chromiumcodereview.appspot.com/15829004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203535 0039d316-1c4b-4281-b951-d872f2087c98
* Add to the list of HTTP headers that don't overwrite in 304 responses.mkwst@chromium.org2013-02-051-0/+34
| | | | | | | | | | | | | | | | Entity headers, such as those prefixed by 'Content-', 'X-WebKit-', and 'X-Content-', should only be accepted on the original response, not on 304 responses for the same resource. This patch adds some specific headers ('X-XSS-Protection', 'X-Frame-Options'), and adds support for prefixes we should ignore on these response. BUG=174301 Review URL: https://chromiumcodereview.appspot.com/12224008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180724 0039d316-1c4b-4281-b951-d872f2087c98
* Default to GMT when parsing HTTP "Date", "Expires" and "Last-Modified" headers.pauljensen@chromium.org2012-10-291-0/+30
| | | | | | | | | | BUG=153759 TEST=net_unittests --gtest_filter=HttpResponseHeadersTest.DefaultDateToGMT Review URL: https://chromiumcodereview.appspot.com/11269011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164762 0039d316-1c4b-4281-b951-d872f2087c98
* Fix removal of headersbattre@chromium.org2012-07-241-1/+29
| | | | | | | | | | | | HttpResponseHeaders::RemoveHeaderWithValue did not correctly remove headers if the passed value contained a comma. For a header "Foo: bar, baz", RemoveHeaderWithValue("Foo", "bar, baz") would be be a non-op. This CL fixes that. As the web request API is the only consumer of this function, there will be no side effects on other code due to the changed behavior. BUG=137396 TEST=no Review URL: https://chromiumcodereview.appspot.com/10809011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148078 0039d316-1c4b-4281-b951-d872f2087c98
* (Finally) Remove NetLog::EventParameters.mmenke@chromium.org2012-06-191-0/+1
| | | | | | | | | R=eroman@chromium.org BUG=126243 Review URL: https://chromiumcodereview.appspot.com/10565009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142953 0039d316-1c4b-4281-b951-d872f2087c98
* Make NetLog take in callbacks that return Values rathermmenke@chromium.org2012-06-101-0/+28
| | | | | | | | | | | | than refcounted objects. Avoids the need to create classes and copy data. Also no longer get time whenever an event is logged. BUG=126243 Review URL: https://chromiumcodereview.appspot.com/10399083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141377 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor Pickle Read methods to use higher performance PickleIterator.jbates@chromium.org2012-03-071-1/+1
| | | | | | | | | | | | | | | | There was a lot of redundant error checking and initialization code in all Pickle Read methods because of the void** iterator type. This change replaces the void* iterator with PickleIterator, which encapsulates the read pointer so that less error checking and initialization code is needed for reading. PickleIterator has all the necessary data to do the actual reading. The advantage of having it provide Read methods (as opposed to leaving them solely in the Pickle interface) is that the callers do not need to pass around the const Pickle* once they have a PickleIterator. Followup CLs will refactor the call sites to remove const Pickle* arguments where they are now unnecessary. Then the Pickle::Read* methods can be removed entirely. The alternative approach would have been to change the Pickle::Read methods to non-const and remove the iterator parameter (making Read methods advance an internal read pointer). Unfortunately, the const Read with iterator design is entrenched throughout the chromium code, making this a much more complex change with the same performance outcome. BUG=13108 Review URL: https://chromiumcodereview.appspot.com/9447084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125447 0039d316-1c4b-4281-b951-d872f2087c98
* Do not cache Strict-Transport-Security and Public-Key-Pins headers.palmer@chromium.org2012-02-131-1/+13
| | | | | | | | | | | | | This stops them from being honored (since they are absent) when loading pages from cache. These headers should only take effect on live, error-free HTTPS connections. BUG=110817 TEST=net_unittests, HTTPSRequestTest.HTTPSErrorsNoClobberTSSTest Review URL: http://codereview.chromium.org/9233026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121747 0039d316-1c4b-4281-b951-d872f2087c98
* Improve merging of header modifications in webRequest.OnHeadersReceivedbattre@chromium.org2011-11-211-0/+66
| | | | | | | | | | | | | This CL enables two independent extensions to modify headers of HTTP responses in case they don't conflict (two extension try to edit the same header). BUG=none TEST=no Review URL: http://codereview.chromium.org/8511063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110900 0039d316-1c4b-4281-b951-d872f2087c98
* Removed wchat_t from Time::FromString.shinyak@google.com2011-08-031-3/+3
| | | | | | | | | | | | Also, some of the test case are moved for pr_time_unittests to time_unittests. BUG=77962 TEST=base_unittests:TimeTest.* Review URL: http://codereview.chromium.org/7492063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95207 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 94426 - Removed wchat_t from Time::FromString.morrita@chromium.org2011-07-281-3/+3
| | | | | | | | | | | | | | | Also, some of the test case are moved for pr_time_unittests to time_unitests. BUG=77962 TEST=base_unittests:TimeTest.* Review URL: http://codereview.chromium.org/7470038 TBR=shinyak@google.com Review URL: http://codereview.chromium.org/7520021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94427 0039d316-1c4b-4281-b951-d872f2087c98
* Removed wchat_t from Time::FromString.shinyak@google.com2011-07-281-3/+3
| | | | | | | | | | | | Also, some of the test case are moved for pr_time_unittests to time_unitests. BUG=77962 TEST=base_unittests:TimeTest.* Review URL: http://codereview.chromium.org/7470038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94426 0039d316-1c4b-4281-b951-d872f2087c98
* Upstream android net related code (part 2)michaelbai@google.com2011-07-071-5/+5
| | | | | | | | | | | Add std:: to find() and replace() calls BUG= TEST= Review URL: http://codereview.chromium.org/7273081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91728 0039d316-1c4b-4281-b951-d872f2087c98
* Add a unit test to verify that an invalid status code (-1)wtc@chromium.org2011-06-011-0/+13
| | | | | | | | | | | | | won't cause the HttpResponseHeaders constructor to crash. R=eroman@chromium.org BUG=none TEST=net_unittests --gtest_filter= HttpResponseHeadersTest.NormalizeHeadersInvalidStatusCode Review URL: http://codereview.chromium.org/7107001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87545 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 85821 - Http cache: Make sure that we don't use http 1.1 featuresrvargas@google.com2011-05-191-2/+8
| | | | | | | | | | | for http 1.0 resources. BUG=74061 TEST=netunittests Review URL: http://codereview.chromium.org/6995010 Review URL: http://codereview.chromium.org/7042027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85857 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 85821 - Http cache: Make sure that we don't use http 1.1 featuresrvargas@google.com2011-05-191-8/+2
| | | | | | | | | | | | | for http 1.0 resources. BUG=74061 TEST=netunittests Review URL: http://codereview.chromium.org/6995010 TBR=rvargas@google.com Review URL: http://codereview.chromium.org/7034044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85853 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Make sure that we don't use http 1.1 featuresrvargas@google.com2011-05-181-2/+8
| | | | | | | | | | for http 1.0 resources. BUG=74061 TEST=netunittests Review URL: http://codereview.chromium.org/6995010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85821 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r83048 "Removed wchar_t from Time::FromString."maruel@chromium.org2011-04-261-4/+4
| | | | | | | | | | | | This causes regression on KeywordProviderTest.Edit on clang produced executable. TBR=shinyak BUG= TEST= Review URL: http://codereview.chromium.org/6893031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83055 0039d316-1c4b-4281-b951-d872f2087c98
* Removed wchar_t from Time::FromString.shinyak@google.com2011-04-261-4/+4
| | | | | | | | | | | | | Also, some of the test case are moved from pr_time_unittests to time_unittests. BUG=77962 TEST=base_unittests:TimeTest.* Review URL: http://codereview.chromium.org/6903022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83048 0039d316-1c4b-4281-b951-d872f2087c98
* Remove "using namespace std" which is illegal per style guide.pkasting@chromium.org2010-11-101-110/+113
| | | | | | | | | | Also remove the other using directives, most of which were already explicitly qualified at various places in the file anyway. BUG=none TEST=none Review URL: http://codereview.chromium.org/4660009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65618 0039d316-1c4b-4281-b951-d872f2087c98
* Convert implicit scoped_refptr constructor calls to explicit ones, part 1thakis@chromium.org2010-11-011-40/+40
| | | | | | | | | | | This CL was created automatically by this clang rewriter: http://codereview.appspot.com/2776043/ . I manually fixed a few rough spots of the rewriter output (doh1-3) and fixed all presubmit errors. BUG=28083 TEST=None Review URL: http://codereview.chromium.org/4192012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64573 0039d316-1c4b-4281-b951-d872f2087c98
* Auto-format style pass over files.cbentzel@chromium.org2010-05-041-43/+43
| | | | | | | | | | | This is a refactor (actually reformat) only - no behavior change in place. BUG=NONE TEST=net_unittests.exe Review URL: http://codereview.chromium.org/1800003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46349 0039d316-1c4b-4281-b951-d872f2087c98
* Http cache: Avoid resuming (and keeping) truncated entriesrvargas@google.com2010-01-081-0/+54
| | | | | | | | | | | | | | | | | | if the server doesn't provide a strong validator. We require: - A strong etag or a strong last modified date. - The total Content length. - Lack of an explicit rejection of ranges (Accept-ranges: none) This aligns better with the conditions used by Firefox. BUG=30220, b/2329250 TEST=unittests Review URL: http://codereview.chromium.org/517043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35761 0039d316-1c4b-4281-b951-d872f2087c98
* HTTP Cache: Apply all freshness tests to Partial content entries.rvargas@google.com2009-10-161-0/+24
| | | | | | | | | BUG=24057 TEST=unittest Review URL: http://codereview.chromium.org/267122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29301 0039d316-1c4b-4281-b951-d872f2087c98
* net: Add another unit test.rvargas@google.com2009-10-151-0/+7
| | | | | | | | | | | I forgot to add a test case that was failing before r29035 BUG=b/2071330 TEST=unittests Review URL: http://codereview.chromium.org/281004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29157 0039d316-1c4b-4281-b951-d872f2087c98
* Http Cache: More unit tests for byte range support.rvargas@google.com2009-10-141-33/+45
| | | | | | | | | BUG=b/2071330 TEST=unittests Review URL: http://codereview.chromium.org/267101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29035 0039d316-1c4b-4281-b951-d872f2087c98