@@ -74,12 +74,12 @@ public function request(string $method, string $url, array $options = []): Respo
74
74
$ options ['body ' ] = self ::getBodyAsString ($ options ['body ' ]);
75
75
76
76
if ('' !== $ options ['body ' ] && 'POST ' === $ method && !isset ($ options ['headers ' ]['content-type ' ])) {
77
- $ options ['request_headers ' ][] = 'content-type : application/x-www-form-urlencoded ' ;
77
+ $ options ['request_headers ' ][] = 'Content-Type : application/x-www-form-urlencoded ' ;
78
78
}
79
79
80
80
if ($ gzipEnabled = \extension_loaded ('zlib ' ) && !isset ($ options ['headers ' ]['accept-encoding ' ])) {
81
81
// gzip is the most widely available algo, no need to deal with deflate
82
- $ options ['request_headers ' ][] = 'accept-encoding : gzip ' ;
82
+ $ options ['request_headers ' ][] = 'Accept-Encoding : gzip ' ;
83
83
}
84
84
85
85
if ($ options ['peer_fingerprint ' ]) {
@@ -161,11 +161,11 @@ public function request(string $method, string $url, array $options = []): Respo
161
161
[$ host , $ port , $ url ['authority ' ]] = self ::dnsResolve ($ url , $ this ->multi , $ info , $ onProgress );
162
162
163
163
if (!isset ($ options ['headers ' ]['host ' ])) {
164
- $ options ['request_headers ' ][] = 'host : ' .$ host .$ port ;
164
+ $ options ['request_headers ' ][] = 'Host : ' .$ host .$ port ;
165
165
}
166
166
167
167
if (!isset ($ options ['headers ' ]['user-agent ' ])) {
168
- $ options ['request_headers ' ][] = 'user-agent : Symfony HttpClient/Native ' ;
168
+ $ options ['request_headers ' ][] = 'User-Agent : Symfony HttpClient/Native ' ;
169
169
}
170
170
171
171
$ context = [
@@ -393,7 +393,7 @@ private static function createRedirectResolver(array $options, string $host, ?ar
393
393
if (false !== (parse_url ($ location , PHP_URL_HOST ) ?? false )) {
394
394
// Authorization and Cookie headers MUST NOT follow except for the initial host name
395
395
$ requestHeaders = $ redirectHeaders ['host ' ] === $ host ? $ redirectHeaders ['with_auth ' ] : $ redirectHeaders ['no_auth ' ];
396
- $ requestHeaders [] = 'host : ' .$ host .$ port ;
396
+ $ requestHeaders [] = 'Host : ' .$ host .$ port ;
397
397
self ::configureHeadersAndProxy ($ context , $ host , $ requestHeaders , $ proxy , $ noProxy );
398
398
}
399
399
0 commit comments