typescript issue on build resolved
This commit is contained in:
parent
aedba86ae3
commit
22cb42e06e
@ -184,6 +184,7 @@ export function Requests({ onViewRequest }: RequestsProps) {
|
|||||||
statsEndDate ? statsEndDate.toISOString() : undefined,
|
statsEndDate ? statsEndDate.toISOString() : undefined,
|
||||||
undefined, // status - All Requests stats show all statuses, not filtered by status
|
undefined, // status - All Requests stats show all statuses, not filtered by status
|
||||||
filtersWithoutStatus?.priority,
|
filtersWithoutStatus?.priority,
|
||||||
|
undefined, // templateType
|
||||||
filtersWithoutStatus?.department,
|
filtersWithoutStatus?.department,
|
||||||
filtersWithoutStatus?.initiator,
|
filtersWithoutStatus?.initiator,
|
||||||
filtersWithoutStatus?.approver,
|
filtersWithoutStatus?.approver,
|
||||||
|
|||||||
@ -379,7 +379,7 @@ function extractFilenameFromContentDisposition(contentDisposition: string | null
|
|||||||
|
|
||||||
// Try to extract from filename* first (RFC 5987 encoded) - preferred for non-ASCII
|
// Try to extract from filename* first (RFC 5987 encoded) - preferred for non-ASCII
|
||||||
const filenameStarMatch = contentDisposition.match(/filename\*=UTF-8''([^;]+)/);
|
const filenameStarMatch = contentDisposition.match(/filename\*=UTF-8''([^;]+)/);
|
||||||
if (filenameStarMatch) {
|
if (filenameStarMatch && filenameStarMatch[1]) {
|
||||||
try {
|
try {
|
||||||
return decodeURIComponent(filenameStarMatch[1]);
|
return decodeURIComponent(filenameStarMatch[1]);
|
||||||
} catch {
|
} catch {
|
||||||
@ -389,9 +389,11 @@ function extractFilenameFromContentDisposition(contentDisposition: string | null
|
|||||||
|
|
||||||
// Fallback to regular filename (for ASCII-only filenames)
|
// Fallback to regular filename (for ASCII-only filenames)
|
||||||
const filenameMatch = contentDisposition.match(/filename="?([^";]+)"?/);
|
const filenameMatch = contentDisposition.match(/filename="?([^";]+)"?/);
|
||||||
if (filenameMatch) {
|
if (filenameMatch && filenameMatch.length > 1 && filenameMatch[1]) {
|
||||||
// Remove quotes and extract only the filename part (before any semicolon)
|
// Remove quotes and extract only the filename part (before any semicolon)
|
||||||
const extracted = filenameMatch[1].replace(/^"|"$/g, '').split(';')[0].trim();
|
const filenameValue: string = filenameMatch[1];
|
||||||
|
const parts = filenameValue.replace(/^"|"$/g, '').split(';');
|
||||||
|
const extracted = parts[0]?.trim();
|
||||||
return extracted || 'download';
|
return extracted || 'download';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user