Skip to content

Commit

Permalink
fix: broken if_not_modified_since (#4377)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvikan authored Dec 29, 2024
1 parent f0db6a2 commit 152e96d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ function getContents(

// TODO: consider url validation at this point

$config = [
'useragent' => Configuration::getConfig('http', 'useragent'),
'timeout' => Configuration::getConfig('http', 'timeout'),
'retries' => Configuration::getConfig('http', 'retries'),
'curl_options' => $curlOptions,
];

$httpHeadersNormalized = [];
foreach ($httpHeaders as $httpHeader) {
$parts = explode(':', $httpHeader);
Expand Down Expand Up @@ -69,13 +76,7 @@ function getContents(
'TE' => 'trailers',
];

$config = [
'useragent' => Configuration::getConfig('http', 'useragent'),
'timeout' => Configuration::getConfig('http', 'timeout'),
'retries' => Configuration::getConfig('http', 'retries'),
'headers' => array_merge($defaultHttpHeaders, $httpHeadersNormalized),
'curl_options' => $curlOptions,
];
$config['headers'] = array_merge($defaultHttpHeaders, $httpHeadersNormalized);

$maxFileSize = Configuration::getConfig('http', 'max_filesize');
if ($maxFileSize) {
Expand Down

0 comments on commit 152e96d

Please sign in to comment.