-
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
RxJS Observable.ajax cross domain issue #1732
Comments
As error message mentions, seems like default factory of XHR in rxjs/src/observable/dom/AjaxObservable.ts Lines 28 to 29 in ceb9990
as an immediate workaround, can provide custom factory to XHR such as Observable.ajax({
url:`https://www.reddit.com/r/reactjs.json`,
crossDomain: true,
createXHR: function () {
return new XMLHttpRequest();
}
}) allows bypassing default configurations. I'm not sure if this is expected behavior to set credential by default, or at least need to allow user level configurations to those flags - CC'ing @trxcllnt for asking helps as original author. |
@kwonoj @techniq while I helped with an initial port of the ajax method from RxJS-DOM, I believe @Blesh is responsible for the version that actually made it into the library. It seems we should be doing something similar to the fix for RxJS-DOM#95, and switch how we create the XHR based on the |
Let me try to update implementations. |
- AjaxRequest now support setting withCredentials flag closes ReactiveX#1732, ReactiveX#1711
- AjaxRequest now support setting withCredentials flag closes ReactiveX#1732, ReactiveX#1711
- AjaxRequest now support setting withCredentials flag closes ReactiveX#1732, ReactiveX#1711
This is not fixed: There is still an error the above example, when using rxjs 5+ and redux-observable.
Even adding the headers fails to work. There is no clear solution for this, and the examples from the rdxjs documentation also have the same issue. |
Hi guys, |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
RxJS version:
5.0.0-beta.8
Code to reproduce:
Codepen example
Expected behavior:
Unable to request third party APIs using
Observable.ajax(...)
, although usingwindow.fetch
withObservable.from
works as expectedActual behavior:
Determine if this is a bug with RxJS's Observable.ajax, or just a configuration issue.
Additional information:
The text was updated successfully, but these errors were encountered: