Skip to content

Commit 9c2c424

Browse files
authored
Support HTTP/2.0
1 parent 5ccb3a7 commit 9c2c424

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/MetaLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ public function loadSource(array $source): void
122122
Logger::info('No response from ' . $source['src'] . ' - attempting to re-use cached metadata');
123123
$this->addCachedMetadata($source);
124124
return;
125-
} elseif (preg_match('@^HTTP/1\.[01]\s304\s@', $responseHeaders[0])) {
125+
} elseif (preg_match('@^HTTP/(2\.0|1\.[01])\s304\s@', $responseHeaders[0])) {
126126
// 304 response
127127
Logger::debug('Received HTTP 304 (Not Modified) - attempting to re-use cached metadata');
128128
$this->addCachedMetadata($source);
129129
return;
130-
} elseif (!preg_match('@^HTTP/1\.[01]\s200\s@', $responseHeaders[0])) {
130+
} elseif (!preg_match('@^HTTP/(2\.0|1\.[01])\s200\s@', $responseHeaders[0])) {
131131
// Other error
132132
Logger::info('Error from ' . $source['src'] . ' - attempting to re-use cached metadata');
133133
$this->addCachedMetadata($source);

0 commit comments

Comments
 (0)