Skip to content
Snippets Groups Projects
Commit f2280d6c authored by Andy Green's avatar Andy Green
Browse files

proxy auth fix

parent d55ac45c
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ struct libwebsocket *libwebsocket_client_connect_2(
lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_PEER_ADDRESS),
wsi->u.hdr.ah->c_port);
if (context->proxy_basic_auth_token)
if (context->proxy_basic_auth_token[0])
plen += sprintf((char *)context->service_buffer + plen,
"Proxy-authorization: basic %s\x0d\x0a",
context->proxy_basic_auth_token);
......
......@@ -714,7 +714,7 @@ libwebsocket_set_proxy(struct libwebsocket_context *context, const char *proxy)
if ((unsigned int)(p - proxy) > sizeof(authstring) - 1)
goto auth_too_long;
strncpy(authstring + 6, proxy, p - proxy);
strncpy(authstring, proxy, p - proxy);
// null termination not needed on input
if (lws_b64_encode_string(authstring, (p - proxy),
context->proxy_basic_auth_token,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment