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

Unified Diff: tests/standalone/io/http_redirect_test.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 | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_redirect_test.dart
diff --git a/tests/standalone/io/http_redirect_test.dart b/tests/standalone/io/http_redirect_test.dart
index 3e8bcb47f2da8fb64e2f3a2f55b3dc5331d00a04..ec1bb08500bf003bbe0050eb440a206783ae4e11 100644
--- a/tests/standalone/io/http_redirect_test.dart
+++ b/tests/standalone/io/http_redirect_test.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.
//
@@ -110,10 +110,14 @@ HttpServer setupServer() {
(HttpRequest request) => request.path == "/303src",
(HttpRequest request, HttpResponse response) {
Expect.equals("POST", request.method);
- response.headers.set(HttpHeaders.LOCATION,
- "http://127.0.0.1:${server.port}/303target");
- response.statusCode = HttpStatus.SEE_OTHER;
- response.outputStream.close();
+ Expect.equals(10, request.contentLength);
+ request.inputStream.onData = request.inputStream.read;
+ request.inputStream.onClosed = () {
+ response.headers.set(HttpHeaders.LOCATION,
+ "http://127.0.0.1:${server.port}/303target");
+ response.statusCode = HttpStatus.SEE_OTHER;
+ response.outputStream.close();
+ };
}
);
server.addRequestHandler(
@@ -287,6 +291,8 @@ void testAutoRedirect303POST() {
void onRequest(HttpClientRequest request) {
requestCount++;
+ request.contentLength = 10;
+ request.outputStream.write(new List<int>.fixedLength(10, fill: 0));
request.outputStream.close();
};
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698