fix: pass capture cookies and headers securely to metadata fetcher

- Pass captured cookies and headers from UI state into the backend `fetch_metadata` command.
- Implement secure domain-matching redirect policy in the backend to prevent leaking cookies, headers, and Basic Auth credentials to third-party domains upon redirect.
- Ensure metadata fetches correctly identify authenticated files (e.g. from Gofile) without being redirected to login/error pages.
This commit is contained in:
NimBold
2026-06-29 17:36:43 +03:30
parent 2ff7a1be44
commit 4448895a6b
2 changed files with 50 additions and 8 deletions
+4 -2
View File
@@ -247,7 +247,9 @@ export const AddDownloadsModal = () => {
url: row.sourceUrl,
userAgent: settingsStore.customUserAgent || null,
username: useAuth ? username.trim() || null : login?.username || null,
password: useAuth ? password || null : keychainPassword
password: useAuth ? password || null : keychainPassword,
headers: headers?.trim() || null,
cookies: cookies?.trim() || null
});
setParsedItems(current => updateRowIfCurrent(
current,
@@ -291,7 +293,7 @@ export const AddDownloadsModal = () => {
}
})();
}
}, [parsedItems, pendingAddFilename, password, useAuth, username]);
}, [parsedItems, pendingAddFilename, password, useAuth, username, headers, cookies]);
useEffect(() => {
if (parsedItems.length === 0) {