The custom header options allows %U and %G.

This commit is contained in:
Nikos Mavrogiannopoulos
2014-05-23 11:07:39 +02:00
parent 28943341db
commit 0a1f5f0f55
2 changed files with 8 additions and 6 deletions

View File

@@ -392,7 +392,7 @@ route = 192.168.5.0/255.255.255.0
#route-add-cmd = "ip route add %R dev %D"
#route-del-cmd = "ip route delete %R dev %D"
# This option allows to forward a proxy. The special strings '%U'
# This option allows to forward a proxy. The special keywords '%U'
# and '%G', if present will be replaced by the username and group name.
#proxy-url = http://example.com/
#proxy-url = http://example.com/%U/
@@ -424,7 +424,8 @@ route = 192.168.5.0/255.255.255.0
# authentication and prior to VPN tunnel establishment. You shouldn't
# need to use this option normally; if you do and you think that
# this may help others, please send your settings and reason to
# the openconnect mailing list.
# the openconnect mailing list. The special keywords '%U'
# and '%G', if present will be replaced by the username and group name.
#custom-header = "X-My-Header: hi there"
@end example

View File

@@ -1640,12 +1640,13 @@ static int connect_handler(worker_st * ws)
SEND_ERR(ret);
for (i = 0; i < ws->config->custom_header_size; i++) {
oclog(ws, LOG_DEBUG, "adding custom header '%s'",
ws->config->custom_header[i]);
const char *h = replace_vals(ws, ws->config->custom_header[i]);
oclog(ws, LOG_DEBUG, "adding custom header '%s'", h);
ret =
tls_printf(ws->session, "%s\r\n",
ws->config->custom_header[i]);
tls_printf(ws->session, "%s\r\n", h);
SEND_ERR(ret);
talloc_free(h);
}
/* calculate base MTU */