Skip to content

Commit 152e96d

Browse files
authored
fix: broken if_not_modified_since (#4377)
1 parent f0db6a2 commit 152e96d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/contents.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ function getContents(
2424

2525
// TODO: consider url validation at this point
2626

27+
$config = [
28+
'useragent' => Configuration::getConfig('http', 'useragent'),
29+
'timeout' => Configuration::getConfig('http', 'timeout'),
30+
'retries' => Configuration::getConfig('http', 'retries'),
31+
'curl_options' => $curlOptions,
32+
];
33+
2734
$httpHeadersNormalized = [];
2835
foreach ($httpHeaders as $httpHeader) {
2936
$parts = explode(':', $httpHeader);
@@ -69,13 +76,7 @@ function getContents(
6976
'TE' => 'trailers',
7077
];
7178

72-
$config = [
73-
'useragent' => Configuration::getConfig('http', 'useragent'),
74-
'timeout' => Configuration::getConfig('http', 'timeout'),
75-
'retries' => Configuration::getConfig('http', 'retries'),
76-
'headers' => array_merge($defaultHttpHeaders, $httpHeadersNormalized),
77-
'curl_options' => $curlOptions,
78-
];
79+
$config['headers'] = array_merge($defaultHttpHeaders, $httpHeadersNormalized);
7980

8081
$maxFileSize = Configuration::getConfig('http', 'max_filesize');
8182
if ($maxFileSize) {

0 commit comments

Comments
 (0)