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

Unified Diff: sdk/lib/io/http_impl.dart

Issue 11821046: Always set content length to 0 on redirect requests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/standalone/io/http_redirect_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index 841a614674acb88976deca0d2a23e3db31570748..9bf97008d3498a1c30634e8e53f8d1b1379b3bb7 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -1688,6 +1688,12 @@ class _HttpClientConnection
if (url == null) {
url = new Uri.fromString(_response.headers.value(HttpHeaders.LOCATION));
}
+ // Always set the content length to 0 for redirects.
+ var mutable = _request._headers._mutable;
+ _request._headers._mutable = true;
+ _request._headers.contentLength = 0;
+ _request._headers._mutable = mutable;
+ _request._bodyBytesWritten = 0;
var redirect = new _RedirectInfo(_response.statusCode, method, url);
// The actual redirect is postponed until both response and
// request are done.
« no previous file with comments | « no previous file | tests/standalone/io/http_redirect_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698