fix(http): Update types for TypeScript nullability support

This reverts commit 268884296a.
This commit is contained in:
Miško Hevery
2017-04-17 11:12:53 -07:00
committed by Tobias Bosch
parent 014594fe8f
commit ec028b8109
18 changed files with 138 additions and 128 deletions

View File

@ -75,7 +75,7 @@ export class Request extends Body {
super();
// TODO: assert that url is present
const url = requestOptions.url;
this.url = requestOptions.url;
this.url = requestOptions.url !;
if (requestOptions.params) {
const params = requestOptions.params.toString();
if (params.length > 0) {
@ -88,13 +88,13 @@ export class Request extends Body {
}
}
this._body = requestOptions.body;
this.method = normalizeMethodName(requestOptions.method);
this.method = normalizeMethodName(requestOptions.method !);
// TODO(jeffbcross): implement behavior
// Defaults to 'omit', consistent with browser
this.headers = new Headers(requestOptions.headers);
this.contentType = this.detectContentType();
this.withCredentials = requestOptions.withCredentials;
this.responseType = requestOptions.responseType;
this.withCredentials = requestOptions.withCredentials !;
this.responseType = requestOptions.responseType !;
}
/**