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

Unified Diff: lib/src/barback/barback_server.dart

Issue 1295803003: Upgrade to shelf 0.6.0. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 4 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 | lib/src/oauth2.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/barback/barback_server.dart
diff --git a/lib/src/barback/barback_server.dart b/lib/src/barback/barback_server.dart
index f825bd853240a1e4e746bbec31e7552d3fcee567..879360485ac88ad5c7a99d4399201a23e7a692b7 100644
--- a/lib/src/barback/barback_server.dart
+++ b/lib/src/barback/barback_server.dart
@@ -119,13 +119,15 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
if (error is! AssetNotFoundException) throw error;
return environment.barback.getAssetById(id.addExtension("/index.html"))
.then((asset) {
- if (request.url.path.endsWith('/')) return _serveAsset(request, asset);
+ if (request.url.path.isEmpty || request.url.path.endsWith('/')) {
+ return _serveAsset(request, asset);
+ }
// We only want to serve index.html if the URL explicitly ends in a
// slash. For other URLs, we redirect to one with the slash added to
// implicitly support that too. This follows Apache's behavior.
- logRequest(request, "302 Redirect to ${request.url}/");
- return new shelf.Response.found('${request.url}/');
+ logRequest(request, "302 Redirect to /${request.url}/");
+ return new shelf.Response.found('/${request.url}/');
}).catchError((newError, newTrace) {
// If we find neither the original file or the index, we should report
// the error about the original to the user.
« no previous file with comments | « no previous file | lib/src/oauth2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698