feat: Don't reject m.request Promise if extract callback supplied (#2006)
This commit is contained in:
parent
e90f14ebe0
commit
80b6a1af0d
4 changed files with 36 additions and 3 deletions
|
|
@ -88,7 +88,7 @@ module.exports = function($window, Promise) {
|
|||
if (xhr.readyState === 4) {
|
||||
try {
|
||||
var response = (args.extract !== extract) ? args.extract(xhr, args) : args.deserialize(args.extract(xhr, args))
|
||||
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {
|
||||
if (args.extract !== extract || (xhr.status >= 200 && xhr.status < 300) || xhr.status === 304 || FILE_PROTOCOL_REGEX.test(args.url)) {
|
||||
resolve(cast(args.type, response))
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue