http_proxy: deal with redundant protocol leader

https://github.com/warmcat/libwebsockets/issues/764
This commit is contained in:
Andy Green 2017-01-26 07:27:11 +08:00
parent 76985f256d
commit 71bb400805

View file

@ -1046,6 +1046,10 @@ lws_set_proxy(struct lws_vhost *vhost, const char *proxy)
if (!proxy)
return -1;
/* we have to deal with a possible redundant leading http:// */
if (!strncmp(proxy, "http://", 7))
proxy += 7;
p = strchr(proxy, '@');
if (p) { /* auth is around */