Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
186 changes: 76 additions & 110 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"ejs": "^4.0.1",
"express": "^5.2.1",
"extract-zip": "^2.0.1",
"file-type": "^19.6.0",
"file-type": "^21.3.1",
"formdata-node": "^6.0.3",
"http-proxy-middleware": "^3.0.5",
"isbinaryfile": "^5.0.7",
Expand Down
13 changes: 10 additions & 3 deletions src/lib/helpers/content-encoding.helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { unzipSync, brotliDecompressSync, deflateSync, gzipSync, brotliCompressSync, inflateSync } from 'zlib';
import {
unzipSync,
brotliDecompressSync,
deflateSync,
gzipSync,
brotliCompressSync,
inflateSync,
} from 'zlib';

export function decodeContent(content: Buffer, contentEncoding?: string) {
switch (contentEncoding) {
Expand All @@ -9,7 +16,7 @@ export function decodeContent(content: Buffer, contentEncoding?: string) {
return brotliDecompressSync(content);

case 'deflate':
return deflateSync(content);
return inflateSync(content);

default:
return content;
Expand All @@ -25,7 +32,7 @@ export function encodeContent(content: Buffer, contentEncoding?: string) {
return brotliCompressSync(content);

case 'deflate':
return inflateSync(content);
return deflateSync(content);

default:
return content;
Expand Down
11 changes: 9 additions & 2 deletions src/lib/helpers/token.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ export function getTokenErrorInfo(error: any): TokenErrorInfo {

switch (status) {
case 412:
if (message.toLowerCase().includes('session expired')) {
const lowerMessage = message.toLowerCase();

if (
lowerMessage.includes('session expired') ||
lowerMessage.includes('session has expired')
) {
return {
status,
message,
Expand Down Expand Up @@ -127,8 +132,10 @@ export function isTokenError(error: any): boolean {
* Check if an error indicates an expired session
*/
export function isSessionExpiredError(error: any): boolean {
const message = error.response?.data?.message?.toLowerCase() ?? '';
return (
error.response?.status === 412 &&
error.response?.data?.message?.toLowerCase().includes('session expired')
(message.includes('session expired') ||
message.includes('session has expired'))
);
}
Loading
Loading