Index: packages/dart_style/test/regression/0300/0370.stmt |
diff --git a/packages/dart_style/test/regression/0300/0370.stmt b/packages/dart_style/test/regression/0300/0370.stmt |
index 086bbf8f9904207c64a02a015a43bbb4ee6cd811..4f936d6a79a608853b097cd89fb9610cb15d33a9 100644 |
--- a/packages/dart_style/test/regression/0300/0370.stmt |
+++ b/packages/dart_style/test/regression/0300/0370.stmt |
@@ -36,35 +36,40 @@ return environment.barback.getAssetById(id).then((result) { |
return notFound(request, asset: id); |
}); |
<<< |
-return environment.barback.getAssetById(id).then((result) { |
- return result; |
-}).then((asset) => _serveAsset(request, asset)).catchError((error, trace) { |
- 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); |
+return environment.barback |
+ .getAssetById(id) |
+ .then((result) { |
+ return result; |
+ }) |
+ .then((asset) => _serveAsset(request, asset)) |
+ .catchError((error, trace) { |
+ 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); |
- // 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}/'); |
- }).catchError((newError, newTrace) { |
- // If we find neither the original file or the index, we should report |
- // the error about the original to the user. |
- throw newError is AssetNotFoundException ? error : newError; |
- }); |
-}).catchError((error, trace) { |
- if (error is! AssetNotFoundException) { |
- trace = new Chain.forTrace(trace); |
- logRequest(request, "$error\n$trace"); |
+ // 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}/'); |
+ }).catchError((newError, newTrace) { |
+ // If we find neither the original file or the index, we should report |
+ // the error about the original to the user. |
+ throw newError is AssetNotFoundException ? error : newError; |
+ }); |
+ }) |
+ .catchError((error, trace) { |
+ if (error is! AssetNotFoundException) { |
+ trace = new Chain.forTrace(trace); |
+ logRequest(request, "$error\n$trace"); |
- addError(error, trace); |
- close(); |
- return new shelf.Response.internalServerError(); |
- } |
+ addError(error, trace); |
+ close(); |
+ return new shelf.Response.internalServerError(); |
+ } |
- addResult(new BarbackServerResult._failure(request.url, id, error)); |
- return notFound(request, asset: id); |
-}); |
+ addResult(new BarbackServerResult._failure(request.url, id, error)); |
+ return notFound(request, asset: id); |
+ }); |