fix(http) : set response.ok based on given status code#8056
Conversation
| constructor(responseOptions: ResponseOptions) { | ||
| this._body = responseOptions.body; | ||
| this.status = responseOptions.status; | ||
| this.ok = (this.status >= 200 && this.status <= 299); |
There was a problem hiding this comment.
I think success would be a better field name.
There was a problem hiding this comment.
@mhevery , I am in agreement with you on this but the spec for fetch's response object has it defined as ok (ref: https://developer.mozilla.org/en-US/docs/Web/API/Response/ok, https://github.com/nexus-uw/angular/blob/http/fix-ok/modules/angular2/src/http/static_response.ts#L21-L25).
There was a problem hiding this comment.
OK, let's follow the spec.
|
Please address the comment. looks good otherwise. |
|
Merging PR #8056 on behalf of @robertmesserle to branch presubmit-robertmesserle-pr-8056. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
bug fix
response.ok is not defined
response.ok is set to true if status is 200-299 (as already documented)
closes #6503