Commit 451c8e92 authored by joi@chromium.org's avatar joi@chromium.org

Don't throttle unless origin schema is chrome-extension.

BUG=83775


Review URL: http://codereview.chromium.org/9819001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128196 0039d316-1c4b-4281-b951-d872f2087c98
parent 808871d2
<div id=http-throttling-view-tab-content class=content-box> <div id=http-throttling-view-tab-content class=content-box>
<p> <p>
In order to prevent Distributed Denial of Service (DDoS) attacks from In order to prevent Distributed Denial of Service (DDoS) attacks from
being perpetrated by web pages and extensions that run within Chrome, the being perpetrated by web pages or extensions that run within Chrome, the
HTTP throttling mechanism keeps track of errors requesting a given URL HTTP throttling mechanism keeps track of errors requesting a given URL
(minus the query parameters), and after a few 5xx errors in a row, starts (minus the query parameters), and after a few 5xx errors in a row, starts
exponentially increasing an interval during which requests to the exponentially increasing an interval during which requests to the
given URL are disallowed. given URL are disallowed.
</p><p> </p><p>
You may enable or disable the feature below. Please let us know if the This feature is currently configured to affect only requests
feature is causing problems for your web site. More details and contact initiated by origins with one of the following schemas:
information at <ul>
<li> chrome-extension:// </li>
</ul>
</p><p>
The feature is on by default (for requests originating from the
schemas listed above). You may disable the feature below if desired.
Please let us know if the feature is causing problems for your web
site. More details and contact information at
<a href="http://dev.chromium.org/throttling" target=_blank>http://dev.chromium.org/throttling</a>. <a href="http://dev.chromium.org/throttling" target=_blank>http://dev.chromium.org/throttling</a>.
</p> </p>
<p><input id=http-throttling-view-enable-checkbox type=checkbox /> <p><input id=http-throttling-view-enable-checkbox type=checkbox />
......
...@@ -320,7 +320,13 @@ void URLRequestHttpJob::StartTransactionInternal() { ...@@ -320,7 +320,13 @@ void URLRequestHttpJob::StartTransactionInternal() {
rv = request_->context()->http_transaction_factory()->CreateTransaction( rv = request_->context()->http_transaction_factory()->CreateTransaction(
&transaction_); &transaction_);
if (rv == OK) { if (rv == OK) {
// TODO(joi): The hard-coded check for "chrome-extension" is
// temporary (as of 2012/3/21), intended only to make sure this
// change (to throttle only requests originating from
// extensions) gets into M19. Right after the M19 branch point,
// I will sort this out in a more architecturally-sound way.
if (!URLRequestThrottlerManager::GetInstance()->enforce_throttling() || if (!URLRequestThrottlerManager::GetInstance()->enforce_throttling() ||
request_->first_party_for_cookies().scheme() != "chrome-extension" ||
!throttling_entry_->ShouldRejectRequest(request_info_.load_flags)) { !throttling_entry_->ShouldRejectRequest(request_info_.load_flags)) {
rv = transaction_->Start( rv = transaction_->Start(
&request_info_, start_callback_, request_->net_log()); &request_info_, start_callback_, request_->net_log());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment