mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
proxy: allow use of at char in passwords
Applies to both http proxy and socks proxy https://github.com/warmcat/libwebsockets/issues/1247
This commit is contained in:
parent
97e36d8901
commit
4c5138eade
1 changed files with 2 additions and 2 deletions
|
@ -1770,7 +1770,7 @@ lws_set_proxy(struct lws_vhost *vhost, const char *proxy)
|
|||
if (!strncmp(proxy, "http://", 7))
|
||||
proxy += 7;
|
||||
|
||||
p = strchr(proxy, '@');
|
||||
p = strrchr(proxy, '@');
|
||||
if (p) { /* auth is around */
|
||||
|
||||
if ((unsigned int)(p - proxy) > sizeof(authstring) - 1)
|
||||
|
@ -1829,7 +1829,7 @@ lws_set_socks(struct lws_vhost *vhost, const char *socks)
|
|||
vhost->socks_user[0] = '\0';
|
||||
vhost->socks_password[0] = '\0';
|
||||
|
||||
p_at = strchr(socks, '@');
|
||||
p_at = strrchr(socks, '@');
|
||||
if (p_at) { /* auth is around */
|
||||
if ((unsigned int)(p_at - socks) > (sizeof(user)
|
||||
+ sizeof(password) - 2)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue