File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1517,7 +1517,8 @@ class Component {
1517
1517
const backendResponse = new BackendResponse ( response ) ;
1518
1518
thisPromiseResolve ( backendResponse ) ;
1519
1519
const html = await backendResponse . getBody ( ) ;
1520
- if ( backendResponse . response . headers . get ( 'Content-Type' ) !== 'application/vnd.live-component+html' ) {
1520
+ const headers = backendResponse . response . headers ;
1521
+ if ( headers . get ( 'Content-Type' ) !== 'application/vnd.live-component+html' && ! headers . get ( 'X-Live-Redirect' ) ) {
1521
1522
this . renderError ( html ) ;
1522
1523
return response ;
1523
1524
}
Original file line number Diff line number Diff line change @@ -302,7 +302,8 @@ export default class Component {
302
302
thisPromiseResolve ( backendResponse ) ;
303
303
const html = await backendResponse . getBody ( ) ;
304
304
// if the response does not contain a component, render as an error
305
- if ( backendResponse . response . headers . get ( 'Content-Type' ) !== 'application/vnd.live-component+html' ) {
305
+ const headers = backendResponse . response . headers ;
306
+ if ( headers . get ( 'Content-Type' ) !== 'application/vnd.live-component+html' && ! headers . get ( 'X-Live-Redirect' ) ) {
306
307
this . renderError ( html ) ;
307
308
308
309
return response ;
Original file line number Diff line number Diff line change 47
47
class LiveComponentSubscriber implements EventSubscriberInterface, ServiceSubscriberInterface
48
48
{
49
49
private const HTML_CONTENT_TYPE = 'application/vnd.live-component+html ' ;
50
+ private const REDIRECT_HEADER = 'X-Live-Redirect ' ;
50
51
51
52
public function __construct (private ContainerInterface $ container )
52
53
{
@@ -282,7 +283,7 @@ public function onKernelResponse(ResponseEvent $event): void
282
283
283
284
$ event ->setResponse (new Response (null , 204 , [
284
285
'Location ' => $ response ->headers ->get ('Location ' ),
285
- ' Content-Type ' => self :: HTML_CONTENT_TYPE ,
286
+ self :: REDIRECT_HEADER => 1 ,
286
287
]));
287
288
}
288
289
You can’t perform that action at this time.
0 commit comments