diff --git a/tdrive/backend/node/src/services/applications-api/index.ts b/tdrive/backend/node/src/services/applications-api/index.ts index 6606ae83..33da4733 100644 --- a/tdrive/backend/node/src/services/applications-api/index.ts +++ b/tdrive/backend/node/src/services/applications-api/index.ts @@ -40,18 +40,18 @@ export default class ApplicationsApiService extends TdriveService { validateStatus: null, }); + // Headers + for (const key in response.headers) { + rep.header(key, response.headers[key]); + } + rep.statusCode = response.status; + // Redirects if (response.status === 301 || response.status === 302) { rep.redirect(response.headers.location); return; } - // Headers - for (const key in response.headers) { - rep.header(key, response.headers[key]); - } - - rep.statusCode = response.status; rep.send(response.data); } catch (err) { console.error(`${err}`);