@ -787,6 +787,14 @@
< / table >
< / table >
< / fieldset >
< / fieldset >
< / fieldset >
< / fieldset >
< fieldset class = "settings" >
< legend >
< input type = "checkbox" id = "webUIUseCustomHTTPHeadersCheckbox" onclick = "qBittorrent.Preferences.updateWebUICustomHTTPHeadersSettings();" / >
< label for = "webUIUseCustomHTTPHeadersCheckbox" > QBT_TR(Add custom HTTP headers)QBT_TR[CONTEXT=OptionsDialog]< / label >
< / legend >
< textarea id = "webUICustomHTTPHeadersTextarea" placeholder = "QBT_TR(Header: value pairs, one per line)QBT_TR[CONTEXT=OptionsDialog]" style = "width: 90%;" > < / textarea >
< / fieldset >
< / fieldset >
< / fieldset >
< fieldset class = "settings" >
< fieldset class = "settings" >
@ -1139,6 +1147,7 @@
updateBypasssAuthSettings: updateBypasssAuthSettings,
updateBypasssAuthSettings: updateBypasssAuthSettings,
updateAlternativeWebUISettings: updateAlternativeWebUISettings,
updateAlternativeWebUISettings: updateAlternativeWebUISettings,
updateHostHeaderValidationSettings: updateHostHeaderValidationSettings,
updateHostHeaderValidationSettings: updateHostHeaderValidationSettings,
updateWebUICustomHTTPHeadersSettings: updateWebUICustomHTTPHeadersSettings,
updateDynDnsSettings: updateDynDnsSettings,
updateDynDnsSettings: updateDynDnsSettings,
registerDynDns: registerDynDns,
registerDynDns: registerDynDns,
applyPreferences: applyPreferences
applyPreferences: applyPreferences
@ -1381,6 +1390,11 @@
$('webui_domain_textarea').setProperty('disabled', !isHostHeaderValidationEnabled);
$('webui_domain_textarea').setProperty('disabled', !isHostHeaderValidationEnabled);
};
};
const updateWebUICustomHTTPHeadersSettings = function() {
const isEnabled = $('webUIUseCustomHTTPHeadersCheckbox').getProperty('checked');
$('webUICustomHTTPHeadersTextarea').setProperty('disabled', !isEnabled);
};
const updateDynDnsSettings = function() {
const updateDynDnsSettings = function() {
const isDynDnsEnabled = $('use_dyndns_checkbox').getProperty('checked');
const isDynDnsEnabled = $('use_dyndns_checkbox').getProperty('checked');
$('dyndns_select').setProperty('disabled', !isDynDnsEnabled);
$('dyndns_select').setProperty('disabled', !isDynDnsEnabled);
@ -1737,6 +1751,11 @@
$('host_header_validation_checkbox').setProperty('checked', pref.web_ui_host_header_validation_enabled);
$('host_header_validation_checkbox').setProperty('checked', pref.web_ui_host_header_validation_enabled);
updateHostHeaderValidationSettings();
updateHostHeaderValidationSettings();
// Custom HTTP headers
$('webUIUseCustomHTTPHeadersCheckbox').setProperty('checked', pref.web_ui_use_custom_http_headers_enabled);
$('webUICustomHTTPHeadersTextarea').setProperty('value', pref.web_ui_custom_http_headers);
updateWebUICustomHTTPHeadersSettings();
// Update my dynamic domain name
// Update my dynamic domain name
$('use_dyndns_checkbox').setProperty('checked', pref.dyndns_enabled);
$('use_dyndns_checkbox').setProperty('checked', pref.dyndns_enabled);
$('dyndns_select').setProperty('value', pref.dyndns_service);
$('dyndns_select').setProperty('value', pref.dyndns_service);
@ -2100,11 +2119,16 @@
settings.set('alternative_webui_enabled', alternative_webui_enabled);
settings.set('alternative_webui_enabled', alternative_webui_enabled);
settings.set('alternative_webui_path', webui_files_location_textarea);
settings.set('alternative_webui_path', webui_files_location_textarea);
// Security
settings.set('web_ui_clickjacking_protection_enabled', $('clickjacking_protection_checkbox').getProperty('checked'));
settings.set('web_ui_clickjacking_protection_enabled', $('clickjacking_protection_checkbox').getProperty('checked'));
settings.set('web_ui_csrf_protection_enabled', $('csrf_protection_checkbox').getProperty('checked'));
settings.set('web_ui_csrf_protection_enabled', $('csrf_protection_checkbox').getProperty('checked'));
settings.set('web_ui_secure_cookie_enabled', $('secureCookieCheckbox').getProperty('checked'));
settings.set('web_ui_secure_cookie_enabled', $('secureCookieCheckbox').getProperty('checked'));
settings.set('web_ui_host_header_validation_enabled', $('host_header_validation_checkbox').getProperty('checked'));
settings.set('web_ui_host_header_validation_enabled', $('host_header_validation_checkbox').getProperty('checked'));
// Custom HTTP headers
settings.set('web_ui_use_custom_http_headers_enabled', $('webUIUseCustomHTTPHeadersCheckbox').getProperty('checked'));
settings.set('web_ui_custom_http_headers', $('webUICustomHTTPHeadersTextarea').getProperty('value'));
// Update my dynamic domain name
// Update my dynamic domain name
settings.set('dyndns_enabled', $('use_dyndns_checkbox').getProperty('checked'));
settings.set('dyndns_enabled', $('use_dyndns_checkbox').getProperty('checked'));
settings.set('dyndns_service', $('dyndns_select').getProperty('value'));
settings.set('dyndns_service', $('dyndns_select').getProperty('value'));