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

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

Issue 950353004: Ship UTF-8 JS in the test http_server. Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 "X-Content-Security-Policy"]) { 390 "X-Content-Security-Policy"]) {
391 response.headers.set(header, content_header_value); 391 response.headers.set(header, content_header_value);
392 } 392 }
393 if (const ["safari"].contains(runtime)) { 393 if (const ["safari"].contains(runtime)) {
394 response.headers.set("X-WebKit-CSP", content_header_value); 394 response.headers.set("X-WebKit-CSP", content_header_value);
395 } 395 }
396 } 396 }
397 if (path.filename.endsWith('.html')) { 397 if (path.filename.endsWith('.html')) {
398 response.headers.set('Content-Type', 'text/html'); 398 response.headers.set('Content-Type', 'text/html');
399 } else if (path.filename.endsWith('.js')) { 399 } else if (path.filename.endsWith('.js')) {
400 response.headers.set('Content-Type', 'application/javascript'); 400 response.headers.set('Content-Type',
401 'application/javascript;charset=UTF-8');
401 } else if (path.filename.endsWith('.dart')) { 402 } else if (path.filename.endsWith('.dart')) {
402 response.headers.set('Content-Type', 'application/dart'); 403 response.headers.set('Content-Type', 'application/dart');
403 } else if (path.filename.endsWith('.css')) { 404 } else if (path.filename.endsWith('.css')) {
404 response.headers.set('Content-Type', 'text/css'); 405 response.headers.set('Content-Type', 'text/css');
405 } else if (path.filename.endsWith('.xml')) { 406 } else if (path.filename.endsWith('.xml')) {
406 response.headers.set('Content-Type', 'text/xml'); 407 response.headers.set('Content-Type', 'text/xml');
407 } 408 }
408 response.headers.removeAll("X-Frame-Options"); 409 response.headers.removeAll("X-Frame-Options");
409 file.openRead().pipe(response).catchError((e) { 410 file.openRead().pipe(response).catchError((e) {
410 DebugLogger.warning( 411 DebugLogger.warning(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 class _Entry implements Comparable { 457 class _Entry implements Comparable {
457 final String name; 458 final String name;
458 final String displayName; 459 final String displayName;
459 460
460 _Entry(this.name, this.displayName); 461 _Entry(this.name, this.displayName);
461 462
462 int compareTo(_Entry other) { 463 int compareTo(_Entry other) {
463 return name.compareTo(other.name); 464 return name.compareTo(other.name);
464 } 465 }
465 } 466 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698