Don't force proxy to http scheme (#119).
authorDaniel Carl <danielcarl@gmx.de>
Sun, 19 Oct 2014 00:46:32 +0000 (02:46 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Sun, 19 Oct 2014 00:52:19 +0000 (02:52 +0200)
doc/vimb.1
src/setting.c

index 29e7d21..593ce90 100644 (file)
@@ -1370,7 +1370,8 @@ started with -e option.
 .TP
 .B http_proxy
 If this variable is set to an none empty value, and the configuration option
-`proxy' is enabled, this will be used as http proxy.
+`proxy' is enabled, this will be used as http proxy. If the proxy URL has no
+scheme set, http is assumed.
 .TP
 .B no_proxy
 A comma separated list of domains and/or ips which should not be proxied. Note
index 22213a5..897d187 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include "config.h"
+#include <string.h>
 #include "main.h"
 #include "setting.h"
 #include "shortcut.h"
@@ -730,7 +731,7 @@ static int proxy(const char *name, int type, void *value, void *data)
         const char *http_proxy = g_getenv("http_proxy");
 
         if (http_proxy != NULL && *http_proxy != '\0') {
-            char *proxy_new = g_str_has_prefix(http_proxy, "http://")
+            char *proxy_new = strstr(http_proxy, "://")
                 ? g_strdup(http_proxy)
                 : g_strconcat("http://", http_proxy, NULL);