File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,7 +66,11 @@ public function handle(ComponentContext $componentContext)
6666
6767 $ entry = $ this ->cacheFrontend ->get ($ entryIdentifier );
6868 if ($ entry ) {
69- $ cachedResponse = parse_response ($ entry );
69+ if (class_exists ('Neos \\Flow \\Http \\Response ' )) {
70+ $ cachedResponse = \Neos \Flow \Http \Response::createFromRaw ($ entry );
71+ } else {
72+ $ cachedResponse = parse_response ($ entry );
73+ }
7074
7175 $ etag = $ cachedResponse ->getHeaderLine ('ETag ' );
7276 $ lifetime = (int )$ cachedResponse ->getHeaderLine ('X-Storage-Lifetime ' );
@@ -79,7 +83,12 @@ public function handle(ComponentContext $componentContext)
7983
8084 $ ifNoneMatch = $ request ->getHeaderLine ('If-None-Match ' );
8185 if ($ ifNoneMatch && $ ifNoneMatch === $ etag ) {
82- $ response = (new Response ( 304 ))
86+ if (class_exists ('Neos \\Flow \\Http \\Response ' )) {
87+ $ response = new \Neos \Flow \Http \Response ();
88+ } else {
89+ $ response = new Response (304 );
90+ }
91+ $ response = $ response
8392 ->withHeader ('CacheControl ' , 'max-age= ' . ($ lifetime - $ age ))
8493 ->withHeader ('X-From-FullPageCache ' , $ entryIdentifier );
8594 } else {
Original file line number Diff line number Diff line change @@ -61,7 +61,12 @@ public function handle(ComponentContext $componentContext)
6161
6262 $ ifNoneMatch = $ request ->getHeaderLine ('If-None-Match ' );
6363 if ($ ifNoneMatch && $ ifNoneMatch === $ etag ) {
64- $ notModifiedResponse = (new Response (304 ))
64+ if (class_exists ('Neos \\Flow \\Http \\Response ' )) {
65+ $ notModifiedResponse = new \Neos \Flow \Http \Response ();
66+ } else {
67+ $ notModifiedResponse = new Response (304 );
68+ }
69+ $ notModifiedResponse = $ notModifiedResponse
6570 ->withAddedHeader ('CacheControl ' , 'max-age= ' . $ lifetime )
6671 ->withHeader ('X-From-FullPageCache ' , $ entryIdentifier );
6772 $ componentContext ->replaceHttpResponse ($ notModifiedResponse );
Original file line number Diff line number Diff line change 44 "name" : " flowpack/fullpagecache" ,
55 "license" : " MIT" ,
66 "require" : {
7- "neos/neos" : " ^5.0 || dev-master"
7+ "neos/neos" : " ~4.3.6 || ^5.0 || dev-master"
88 },
99 "autoload" : {
1010 "psr-4" : {
You can’t perform that action at this time.
0 commit comments