Merge pull request #1001 from neuroscr/patchopensnapps

Fix serverRequest retry
pull/1003/head
Ryan Tharp 5 years ago committed by GitHub
commit a9da21a807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -242,8 +242,8 @@ const serverRequest = async (endpoint, options = {}) => {
FILESERVER_HOSTS.includes(host)
) {
mode = 'sendToProxy';
// strip trailing slash
const search = url.search ? `?${url.search}` : '';
// strip first slash
const endpointWithQS = `${url.pathname}${search}`.replace(/^\//, '');
// log.info('endpointWithQS', endpointWithQS)
({ response, txtResponse, result } = await sendToProxy(
@ -297,7 +297,7 @@ const serverRequest = async (endpoint, options = {}) => {
if (result.status !== 200) {
if (!forceFreshToken && (!response.meta || response.meta.code === 401)) {
// retry with forcing a fresh token
return this.serverRequest(endpoint, {
return serverRequest(endpoint, {
...options,
forceFreshToken: true,
});

Loading…
Cancel
Save