.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
Pass a long that is a bitmask of options of how to deal with headers. The two
mutually exclusive options are:
-\fBCURLHEADER_UNIFIED\fP - keep working as before. This means
-\fICURLOPT_HTTPHEADER(3)\fP headers will be used in requests both to servers
-and proxies. With this option enabled, \fICURLOPT_PROXYHEADER(3)\fP will not
-have any effect.
+\fBCURLHEADER_UNIFIED\fP - the headers specified in
+\fICURLOPT_HTTPHEADER(3)\fP will be used in requests both to servers and
+proxies. With this option enabled, \fICURLOPT_PROXYHEADER(3)\fP will not have
+any effect.
\fBCURLHEADER_SEPARATE\fP - makes \fICURLOPT_HTTPHEADER(3)\fP headers only get
sent to a server and not to a proxy. Proxy headers must be set with
headers only to the proxy and then \fICURLOPT_HTTPHEADER(3)\fP headers only to
the server.
.SH DEFAULT
-CURLHEADER_UNIFIED
+CURLHEADER_SEPARATE (changed in 7.42.1, ased CURLHEADER_UNIFIED before then)
.SH PROTOCOLS
HTTP
.SH EXAMPLE
te
);
- /*
- * Free userpwd for Negotiate/NTLM. Cannot reuse as it is associated with
- * the connection and shouldn't be repeated over it either.
- */
- switch (data->state.authhost.picked) {
- case CURLAUTH_NEGOTIATE:
- case CURLAUTH_NTLM:
- case CURLAUTH_NTLM_WB:
- Curl_safefree(conn->allocptr.userpwd);
- break;
- }
+ /* clear userpwd to avoid re-using credentials from re-used connections */
+ Curl_safefree(conn->allocptr.userpwd);
/*
- * Same for proxyuserpwd
+ * Free proxyuserpwd for Negotiate/NTLM. Cannot reuse as it is associated
+ * with the connection and shouldn't be repeated over it either.
*/
switch (data->state.authproxy.picked) {
case CURLAUTH_NEGOTIATE:
useragent,
proxyconn);
- if(host && *host)
+ if(host)
free(host);
free(hostheader);
off = Curl_read16_le(((unsigned char *) msg) +
sizeof(struct smb_header) + 13);
if(len > 0) {
- result = Curl_client_write(conn, CLIENTWRITE_BODY,
- (char *)msg + off + sizeof(unsigned int),
- len);
+ struct smb_conn *smbc = &conn->proto.smbc;
+ if(off + sizeof(unsigned int) + len > smbc->got) {
+ failf(conn->data, "Invalid input packet");
+ result = CURLE_RECV_ERROR;
+ }
+ else
+ result = Curl_client_write(conn, CLIENTWRITE_BODY,
+ (char *)msg + off + sizeof(unsigned int),
+ len);
if(result) {
req->result = result;
next_state = SMB_CLOSE;
set->ssl_enable_alpn = TRUE;
set->expect_100_timeout = 1000L; /* Wait for a second by default. */
+ set->sep_headers = TRUE; /* separated header lists by default */
return result;
}
Name: curl
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
-Version: 7.40.1_2
+Version: 7.40.1_6
Release: 1
Group: Applications/Internet
License: MIT
BuildRequires: pkgconfig(libidn)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(libcares)
+BuildRequires: pkgconfig(libnghttp2)
Provides: webclient
%package -n libcurl
Summary: A library for getting files from web servers
Group: System/Libraries
+License: MIT
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%package -n libcurl-devel
Summary: Files needed for building applications with libcurl
Group: Development/Libraries
+License: MIT
Requires: libcurl = %{version}-%{release}
Requires: libidn-devel
Provides: curl-devel = %{version}-%{release}
--with-lber-lib=lber \
--enable-manual --enable-versioned-symbols --enable-ares --enable-debug --enable-curldebug \
--disable-static \
+--with-nghttp2=/usr/lib/pkgconfig \
#--with-ca-bundle=%{_sysconfdir}/pki/tls/certs/ca-bundle.crt
# Server-side
<reply>
<connect>
-HTTP/1.1 200 OK\r
-We-are: good\r
-\r
+HTTP/1.1 200 OK
+We-are: good
+
</connect>
<data>
-HTTP/1.1 200 OK swsclose\r
-Date: Thu, 09 Nov 2010 14:49:00 GMT\r
-Server: test-server/fake\r
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT\r
-ETag: "21025-dc7-39462498"\r
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
</data>
<datacheck>
-HTTP/1.1 200 OK\r
-We-are: good\r
-\r
-HTTP/1.1 200 OK swsclose\r
-Date: Thu, 09 Nov 2010 14:49:00 GMT\r
-Server: test-server/fake\r
-Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT\r
-ETag: "21025-dc7-39462498"\r
+HTTP/1.1 200 OK
+We-are: good
+
+HTTP/1.1 200 OK swsclose
+Date: Thu, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
</datacheck>
</reply>
lib1527
</tool>
<name>
-Check same headers are generated without CURLOPT_PROXYHEADER
+Check same headers are generated with CURLOPT_HEADEROPT == CURLHEADER_UNIFIED
</name>
<command>
http://the.old.moo.1527:%HTTPPORT/1527 %HOSTIP:%PROXYPORT
# Verify data after the test has been "shot"
<verify>
<proxy>
-CONNECT the.old.moo.1527:%HTTPPORT HTTP/1.1\r
-Host: the.old.moo.1527:%HTTPPORT\r
-Proxy-Connection: Keep-Alive\r
-User-Agent: Http Agent\r
-Expect: 100-continue\r
-\r
+CONNECT the.old.moo.1527:%HTTPPORT HTTP/1.1
+Host: the.old.moo.1527:%HTTPPORT
+Proxy-Connection: Keep-Alive
+User-Agent: Http Agent
+Expect: 100-continue
+
</proxy>
<protocol>
-PUT /1527 HTTP/1.1\r
-Host: the.old.moo.1527:%HTTPPORT\r
-Accept: */*\r
-User-Agent: Http Agent\r
-Expect: 100-continue\r
-Content-Length: 13\r
-\r
+PUT /1527 HTTP/1.1
+Host: the.old.moo.1527:%HTTPPORT
+Accept: */*
+User-Agent: Http Agent
+Expect: 100-continue
+Content-Length: 13
+
Hello Cloud!
</protocol>
</verify>
<reply>
<connect nocheck="yes">
-HTTP/1.1 405 Method Not Allowed swsclose\r
-\r
+HTTP/1.1 405 Method Not Allowed swsclose
+
And you should ignore this data.
</connect>
HTTP proxy CONNECT with custom User-Agent header
</name>
<command>
-http://test.remote.example.com.287:%HTTPPORT/path/287 -H "User-Agent: looser/2007" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel
+http://test.remote.example.com.287:%HTTPPORT/path/287 -H "User-Agent: looser/2015" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel --proxy-header "User-Agent: looser/2007"
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
-CONNECT test.remote.example.com.287:%HTTPPORT HTTP/1.1\r
-Host: test.remote.example.com.287:%HTTPPORT\r
-Proxy-Connection: Keep-Alive\r
-User-Agent: looser/2007\r
-\r
+CONNECT test.remote.example.com.287:%HTTPPORT HTTP/1.1
+Host: test.remote.example.com.287:%HTTPPORT
+Proxy-Connection: Keep-Alive
+User-Agent: looser/2007
+
</protocol>
# CURLE_RECV_ERROR
<errorcode>
56
</errorcode>
<stdout>
-HTTP/1.1 405 Method Not Allowed swsclose\r
-\r
+HTTP/1.1 405 Method Not Allowed swsclose
+
</stdout>
</verify>
</testcase>
test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
test_setopt(curl, CURLOPT_INFILESIZE, strlen(data));
+ test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
res = curl_easy_perform(curl);