diff --git a/lib/core_dom/http.dart b/lib/core_dom/http.dart index 5123188b7..e8dcc17bc 100644 --- a/lib/core_dom/http.dart +++ b/lib/core_dom/http.dart @@ -764,5 +764,6 @@ class Http { class HttpConfig { final Duration coalesceDuration; - HttpConfig({this.coalesceDuration}); + HttpConfig(); + HttpConfig.withOptions({this.coalesceDuration}); } diff --git a/lib/core_dom/module_internal.dart b/lib/core_dom/module_internal.dart index b7cd7bbbd..151721689 100644 --- a/lib/core_dom/module_internal.dart +++ b/lib/core_dom/module_internal.dart @@ -84,7 +84,7 @@ class CoreDomModule extends Module { bind(HttpDefaultHeaders); bind(HttpDefaults); bind(HttpInterceptors); - bind(HttpConfig, toValue: new HttpConfig()); + bind(HttpConfig); bind(Animate); bind(ViewCache); bind(BrowserCookies); diff --git a/test/core_dom/http_spec.dart b/test/core_dom/http_spec.dart index 95a3a2805..edcf2222b 100644 --- a/test/core_dom/http_spec.dart +++ b/test/core_dom/http_spec.dart @@ -1426,8 +1426,8 @@ void main() { describe('coalesce', () { beforeEachModule((Module module) { - var coalesceDuration = new Duration(milliseconds: 100); - module.bind(HttpConfig, toValue: new HttpConfig(coalesceDuration: coalesceDuration)); + var duration = new Duration(milliseconds: 100); + module.bind(HttpConfig, toValue: new HttpConfig.withOptions(coalesceDuration: duration)); }); it('should coalesce requests', async((Http http) {