Skip to content

Desktop v2.5.0

Compare
Choose a tag to compare
@astralbodies astralbodies released this 23 May 16:43
Fix: http-envelope-normalizer: return request object (#13882)

Resolves #13791

This wrapper appears to try and detect error-like messages in responses
from `wpcom.js` calls and turn them into proper JavaScript `Error`s.

Previously however instead of returning the request object it created it
was returning `undefined`. `wpcom.js` is supposed to return _either_ an
XHR object _or_ a promise for the request. In this case, any code
depending on the return value (XHR updloads, promise resolvers, etc...)
would throw a `TypeError` because `undefined` has no properties.

Now the code _returns_ the augmented request object instead of merely
_calling_ it.

cc: @retrofox