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

Side by Side Diff: tools/testing/dart/http_server.dart

Issue 709483002: Add test/xml content type to test server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library http_server; 5 library http_server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'dart:convert' show 10 import 'dart:convert' show
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 } 394 }
395 } 395 }
396 if (path.filename.endsWith('.html')) { 396 if (path.filename.endsWith('.html')) {
397 response.headers.set('Content-Type', 'text/html'); 397 response.headers.set('Content-Type', 'text/html');
398 } else if (path.filename.endsWith('.js')) { 398 } else if (path.filename.endsWith('.js')) {
399 response.headers.set('Content-Type', 'application/javascript'); 399 response.headers.set('Content-Type', 'application/javascript');
400 } else if (path.filename.endsWith('.dart')) { 400 } else if (path.filename.endsWith('.dart')) {
401 response.headers.set('Content-Type', 'application/dart'); 401 response.headers.set('Content-Type', 'application/dart');
402 } else if (path.filename.endsWith('.css')) { 402 } else if (path.filename.endsWith('.css')) {
403 response.headers.set('Content-Type', 'text/css'); 403 response.headers.set('Content-Type', 'text/css');
404 } else if (path.filename.endsWith('.xml')) {
405 response.headers.set('Content-Type', 'text/xml');
404 } 406 }
405 response.headers.removeAll("X-Frame-Options"); 407 response.headers.removeAll("X-Frame-Options");
406 file.openRead().pipe(response).catchError((e) { 408 file.openRead().pipe(response).catchError((e) {
407 DebugLogger.warning( 409 DebugLogger.warning(
408 'HttpServer: error while closing the response stream', e); 410 'HttpServer: error while closing the response stream', e);
409 }); 411 });
410 } 412 }
411 413
412 void _sendNotFound(HttpRequest request) { 414 void _sendNotFound(HttpRequest request) {
413 bool isHarmlessPath(String path) { 415 bool isHarmlessPath(String path) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 class _Entry implements Comparable { 455 class _Entry implements Comparable {
454 final String name; 456 final String name;
455 final String displayName; 457 final String displayName;
456 458
457 _Entry(this.name, this.displayName); 459 _Entry(this.name, this.displayName);
458 460
459 int compareTo(_Entry other) { 461 int compareTo(_Entry other) {
460 return name.compareTo(other.name); 462 return name.compareTo(other.name);
461 } 463 }
462 } 464 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698