}
+ /**
+ * Valid response statuses.
+ * Allow 401 as a workaround for one specific client which return such on
+ * its client identifier endpoint when not yet authenticated.
+ * @param {Number} status
+ * @returns {Boolean}
+ */
+ static _validateStatus(status) {
+ return (status >= 200 && status < 300) || status == 401;
+ }
+
/**
* A request config skeleton.
* @param {String} method
responseType: 'text',
// So force the matter by eliding all response transformations
transformResponse: [ (res) => res ],
+
+ validateStatus: Communication._validateStatus,
};
Object.entries(params).map(([k, v]) => config.params.set(k, v));
return config;