diff --git a/example/main.dart b/example/main.dart index 9deaefce..022c0769 100644 --- a/example/main.dart +++ b/example/main.dart @@ -14,7 +14,6 @@ main() async { // Forward any /api requests to pub. // By default, if the host throws a 404, the request will fall through to the next handler. var pubProxy = new Proxy( - app, client, 'https://pub.dartlang.org', publicPath: '/pub', @@ -30,7 +29,6 @@ main() async { // Anything else should fall through to dartlang.org. var dartlangProxy = new Proxy( - app, client, 'https://dartlang.org', timeout: timeout, diff --git a/lib/src/proxy_layer.dart b/lib/src/proxy_layer.dart index aa2922e7..92b3129b 100644 --- a/lib/src/proxy_layer.dart +++ b/lib/src/proxy_layer.dart @@ -11,7 +11,6 @@ final MediaType _fallbackMediaType = MediaType('application', 'octet-stream'); class Proxy { String _prefix; - final Angel app; final http.Client httpClient; /// If `true` (default), then the plug-in will ignore failures to connect to the proxy, and allow other handlers to run. @@ -25,7 +24,6 @@ class Proxy { final Duration timeout; Proxy( - this.app, this.httpClient, this.host, { this.port, @@ -88,7 +86,7 @@ class Proxy { var body; - if (req.method != 'GET' && app.keepRawRequestBuffers == true) { + if (req.method != 'GET' && req.app.keepRawRequestBuffers == true) { body = (await req.parse()).originalBuffer; } diff --git a/test/basic_test.dart b/test/basic_test.dart index 943e1368..4cbf826c 100644 --- a/test/basic_test.dart +++ b/test/basic_test.dart @@ -22,14 +22,12 @@ main() { testServer = await startTestServer(); var proxy1 = new Proxy( - app, httpClient, testServer.address.address, port: testServer.port, publicPath: '/proxy', ); var proxy2 = new Proxy( - app, httpClient, testServer.address.address, port: testServer.port, diff --git a/test/pub_serve_test.dart b/test/pub_serve_test.dart index ee0b87c6..a23f5ad3 100644 --- a/test/pub_serve_test.dart +++ b/test/pub_serve_test.dart @@ -34,7 +34,6 @@ main() { var httpClient = new http.Client(); layer = new Proxy( - app, httpClient, server.address.address, port: server.port,