]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Add Content-Length header to mimic official pulse client
authorJon DeVree <nuxi@vault24.org>
Tue, 20 Sep 2016 01:00:18 +0000 (21:00 -0400)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 22 Sep 2016 14:07:07 +0000 (15:07 +0100)
The official pulse client sends in a fixed "Content-Length: 256" header
with these two HTTP requests. Some versions of the VPN server will
reject requests with an HTTP 400 error if they do not have this header.

Signed-off-by: Jon DeVree <nuxi@vault24.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
oncp.c

diff --git a/oncp.c b/oncp.c
index cc9a223a894a3398ff31d13fd3ca12bf93912b9e..2bf15715533c436ef6a1aa758a175bc437e5c0fc 100644 (file)
--- a/oncp.c
+++ b/oncp.c
@@ -562,6 +562,7 @@ int oncp_connect(struct openconnect_info *vpninfo)
 
        buf_append(reqbuf, "POST /dana/js?prot=1&svc=1 HTTP/1.1\r\n");
        oncp_common_headers(vpninfo, reqbuf);
+       buf_append(reqbuf, "Content-Length: 256\r\n");
        buf_append(reqbuf, "\r\n");
 
        if (buf_error(reqbuf)) {
@@ -606,6 +607,7 @@ int oncp_connect(struct openconnect_info *vpninfo)
        buf_truncate(reqbuf);
        buf_append(reqbuf, "POST /dana/js?prot=1&svc=4 HTTP/1.1\r\n");
        oncp_common_headers(vpninfo, reqbuf);
+       buf_append(reqbuf, "Content-Length: 256\r\n");
        buf_append(reqbuf, "\r\n");
 
        if (buf_error(reqbuf)) {