-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AjaxObservable: Redirections (including Not Modified) are wrapped in AjaxError. #3308
Comments
I'm grabbing this! ✋ |
@SleeplessByte thanks for reporting this. It looks like @claudiordgz would like to implement the fix. |
Yes I would! |
claudiordgz
added a commit
to claudiordgz/rxjs
that referenced
this issue
Mar 16, 2018
w3 rfc2616 defines 4xx,5xx status codes as errors, but anything below is a valid response. AjaxObservable errors when a request status returns 1xx and 3xx, passing only 2xx requests. ReactiveX#3308
PR #3438 created, feedback super welcomed 🙏 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
RxJS version:
5.5.6 / stable
Code to reproduce:
Expected behavior:
I get the
AjaxResponse
in the console.log, just like any 2XX response.Actual behavior:
Additional information:
rxjs/src/internal/observable/dom/AjaxObservable.ts
Line 368 in 94156a2
Over here for some reason it defines only status between 200 and 300 (Exclusive) to be "next" worthy. The rest is all piped to an AjaxError. Status codes starting at 400 should error, but the (1XX,) 2XX and 3XX should all be valid responses.
Redirects are (rightly so) not handled, but it should not be an error. Since you get the raw
AjaxResponse
anyway, you'll need handling regardless; but why make a "regular case" (think 304 Not Modified, or a 302 Found) a wrapped result intoAjaxError
.https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
4XX
and5XX
are errors.The text was updated successfully, but these errors were encountered: