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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/server.dart

Issue 160093003: Properly handle a null MIME type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/barback/server.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/server.dart b/sdk/lib/_internal/pub/lib/src/barback/server.dart
index 0ecd417d0c8d313a06637df0811eb0cfb4233465..c783771a6fd63532fdb716ce969be1fca950d201 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/server.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/server.dart
@@ -115,7 +115,10 @@ class BarbackServer {
return validateStream(asset.read()).then((stream) {
_resultsController.add(
new BarbackServerResult._success(request.uri, id));
- request.response.headers.add('content-type', lookupMimeType(id.path));
+ var mimeType = lookupMimeType(id.path);
+ if (mimeType != null) {
+ request.response.headers.add('content-type', mimeType);
+ }
// TODO(rnystrom): Set content-type based on asset type.
return Chain.track(request.response.addStream(stream)).then((_) {
// Log successful requests both so we can provide debugging
« 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