mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-26 02:27:14 +00:00
fix(settings): restrict custom proxy to http
Remove the SOCKS5 example from the Network settings custom proxy field until normal file downloads support it end to end. Reject non-HTTP custom proxy URLs in frontend normalization so Settings cannot emit unsupported proxy schemes to aria2-backed downloads. Update proxy dispatch tests to preserve the HTTP path and cover rejected SOCKS5 and HTTPS custom inputs.
This commit is contained in:
@@ -102,6 +102,7 @@ export const normalizeCustomProxy = (host: string, port: number): string | null
|
||||
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(trimmedHost)) {
|
||||
try {
|
||||
const parsed = new URL(trimmedHost);
|
||||
if (parsed.protocol !== 'http:') return null;
|
||||
if (!parsed.port) parsed.port = String(normalizedPort);
|
||||
return parsed.toString().replace(/\/$/, '');
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user