Code Duplication    Length = 5-5 lines in 2 locations

src/CacheMiddleware.php 2 locations

@@ 215-219 (lines=5) @@
212
                         * @var string $headerName
213
                         * @var string[] $headerValue
214
                         */
215
                        foreach ($cacheEntry->getOriginalResponse()->getHeaders() as $headerName => $headerValue) {
216
                            if (!$response->hasHeader($headerName) && $headerName !== self::HEADER_CACHE_INFO) {
217
                                $response = $response->withHeader($headerName, $headerValue);
218
                            }
219
                        }
220
221
                        $update = true;
222
                    } else {
@@ 299-303 (lines=5) @@
296
                        $response = $response->withBody($cacheEntry->getResponse()->getBody());
297
298
                        // Merge headers of the "304 Not Modified" and the cache entry
299
                        foreach ($cacheEntry->getResponse()->getHeaders() as $headerName => $headerValue) {
300
                            if (!$response->hasHeader($headerName)) {
301
                                $response = $response->withHeader($headerName, $headerValue);
302
                            }
303
                        }
304
305
                        $update = true;
306
                    }