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

Unified Diff: runtime/bin/vmservice/resources.dart

Issue 26686005: Revert 28422 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « runtime/bin/vmservice/gen_resources_sources.sh ('k') | runtime/bin/vmservice/server.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/resources.dart
diff --git a/runtime/bin/vmservice/resources.dart b/runtime/bin/vmservice/resources.dart
index a52d2ba15ba6c83242d3b4c101b545bf33b9e62e..55a5a74ed77a9cb72b4e8d437504285cf23d9107 100644
--- a/runtime/bin/vmservice/resources.dart
+++ b/runtime/bin/vmservice/resources.dart
@@ -5,8 +5,7 @@
part of vmservice;
String detectMimeType(String name) {
- var extensionStart = name.lastIndexOf('.');
- var extension = name.substring(extensionStart+1);
+ var extension = new Path(name).extension;
switch (extension) {
case 'html':
return 'text/html; charset=UTF-8';
@@ -41,6 +40,6 @@ class Resource {
void _addResource(String name, List<int> data) {
var mimeType = detectMimeType(name);
- Resource resource = new Resource(name, mimeType, data);
+ Resource resource = new Resource(name, detectMimeType(name), data);
Resource.resources[name] = resource;
}
« no previous file with comments | « runtime/bin/vmservice/gen_resources_sources.sh ('k') | runtime/bin/vmservice/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698