-
Notifications
You must be signed in to change notification settings - Fork 83
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
#99 allow customization of request configuration #168
Conversation
This also (temporarily) replaces invocations of QueryMethod(...) with QueryMethod.default(...) in existing JS source so it can still be tested.
Fixes dojo#131 by making the default comparison function created in SimpleQuery#_createSortQuerier treat undefined as greater than any value, and null greater than any value besides undefined. This conveniently places all null and undefined values at the end of a sorted list.
Fixes dojo#124 by wrapping the return value from StoreAdapter's fetchRange function in a promise. This function is delegated to by fetch so this handles both cases. Also updated several test cases that were relying on the synchronous behavior of the StoreAdapter.
The `package.json` now accuretly reflects the `LICENSE` that is included with the package.
…y or on per-request basis
actually this may be a more generic form of #87 |
any interest in merging this PR folks? this seems pretty crucial for authenticated CORS regardless of #79 |
Yes, there's interest. We'll try to get to it next week. |
@@ -159,6 +166,10 @@ define([ | |||
}; | |||
}, | |||
|
|||
_getRequestOptions: function(kwArgs, requestOptions, headers, requestUrl) { | |||
return lang.mixin({}, this.requestOptions || {}, requestOptions || {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure the || {}
s here are not necessary (mixin
should default to just skipping over null/undefined things)
Thanks I will review and update. FWIW I discovered a similar issue with |
Typically, this would be handled by creating a custom requestProvider and then usually that requestProvider globally through a configuration setting. I realize this is an area that many people find to be rough. The main reason for thinking that was a better approach was to not have dstore replicate features within dojo/request. That said, there are some obvious rough areas in dstore where we're also not respecting whatever requestOptions are provided. |
I'm not sure what you mean by "involves XHR directly", since |
I assumed @ahamid meant by default in a browser, where xhr is loaded unless overridden. |
@kfranqueiro I just meant that |
…t mixin arguments
1dbb25d
to
a5655fe
Compare
I think #206 will serve the same purpose as this one. |
Addressed in #206. |
...either statically or on per-request basis (addresses #99)
This should allow customization of the dojo/request object (for example, to set
withCredentials: true
) either statically or on a per-request basis via extension.Not currently tested as I couldn't figure out what was needed to satisfy the mock requests for request/rest stores, but I'm willing to add tests if I can get the harness working.