1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

script: remove option script.scripts.url_force_https, use HTTPS by default in option script.scripts.url (issue #253)

This commit is contained in:
Sébastien Helleu
2017-04-23 14:11:27 +02:00
parent ffdf0ec687
commit 2606b8a5a3
23 changed files with 141 additions and 227 deletions
+3 -14
View File
@@ -100,9 +100,6 @@ script_language_search_by_extension (const char *extension)
/*
* Builds download URL (to use with hook_process or hook_process_hashtable).
*
* If the option script.scripts.url_force_https is enabled, the protocol is
* forced to HTTPS (if URL starts with "http://").
*
* Note: result must be freed after use.
*/
@@ -115,21 +112,13 @@ script_build_download_url (const char *url)
if (!url || !url[0])
return NULL;
/* length of url + "url:" + 1 (for httpS) */
length = 4 + 1 + strlen (url) + 1;
/* length of url + "url:" */
length = 4 + strlen (url) + 1;
result = malloc (length);
if (!result)
return NULL;
if (weechat_config_boolean (script_config_scripts_url_force_https)
&& (weechat_strncasecmp (url, "http://", 7) == 0))
{
snprintf (result, length, "url:https://%s", url + 7);
}
else
{
snprintf (result, length, "url:%s", url);
}
snprintf (result, length, "url:%s", url);
return result;
}