| Index: sdk/lib/_internal/pub_generated/lib/src/barback/barback_server.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart b/sdk/lib/_internal/pub_generated/lib/src/barback/barback_server.dart
|
| similarity index 95%
|
| copy from sdk/lib/_internal/pub/lib/src/barback/barback_server.dart
|
| copy to sdk/lib/_internal/pub_generated/lib/src/barback/barback_server.dart
|
| index f825bd853240a1e4e746bbec31e7552d3fcee567..24658e22592e090fdf4139ee289248bc70c63f1d 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/barback/barback_server.dart
|
| +++ b/sdk/lib/_internal/pub_generated/lib/src/barback/barback_server.dart
|
| @@ -51,8 +51,8 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
|
| /// directory. If [rootDirectory] is omitted, the bound server can only be
|
| /// used to serve assets from packages' lib directories (i.e. "packages/..."
|
| /// URLs). If [package] is omitted, it defaults to the entrypoint package.
|
| - static Future<BarbackServer> bind(AssetEnvironment environment,
|
| - String host, int port, {String package, String rootDirectory}) {
|
| + static Future<BarbackServer> bind(AssetEnvironment environment, String host,
|
| + int port, {String package, String rootDirectory}) {
|
| if (package == null) package = environment.rootPackage.name;
|
| return bindServer(host, port).then((server) {
|
| if (rootDirectory == null) {
|
| @@ -64,8 +64,8 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
|
| });
|
| }
|
|
|
| - BarbackServer._(AssetEnvironment environment, HttpServer server,
|
| - this.package, this.rootDirectory)
|
| + BarbackServer._(AssetEnvironment environment, HttpServer server, this.package,
|
| + this.rootDirectory)
|
| : super(environment, server);
|
|
|
| /// Converts a [url] served by this server into an [AssetId] that can be
|
| @@ -108,7 +108,8 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
|
|
|
| // See if the asset should be blocked.
|
| if (allowAsset != null && !allowAsset(id)) {
|
| - return notFound(request,
|
| + return notFound(
|
| + request,
|
| error: "Asset $id is not available in this configuration.",
|
| asset: id);
|
| }
|
| @@ -117,8 +118,8 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
|
| 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) {
|
| + 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
|
| @@ -148,8 +149,9 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
|
| // running "pub serve" in parallel with another development server. Since
|
| // "pub serve" is only used as a development server and doesn't require
|
| // any sort of credentials anyway, this is secure.
|
| - return response.change(
|
| - headers: const {"Access-Control-Allow-Origin": "*"});
|
| + return response.change(headers: const {
|
| + "Access-Control-Allow-Origin": "*"
|
| + });
|
| });
|
| }
|
|
|
|
|