Skip to content

Commit e662c4e

Browse files
committed
Make gooder
1 parent 3b61344 commit e662c4e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/ResponseFactory.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,10 @@ public function render(string $component, $props = []): Response
109109
*/
110110
public function location($url): SymfonyResponse
111111
{
112-
[$url, $redirect] = $url instanceof SymfonyRedirect
113-
? [$url->getTargetUrl(), $url]
114-
: [$url, Redirect::away($url)];
115-
116112
if (Request::inertia()) {
117-
return BaseResponse::make('', 409, ['X-Inertia-Location' => $url]);
113+
return BaseResponse::make('', 409, ['X-Inertia-Location' => $url instanceof SymfonyRedirect ? $url->getTargetUrl() : $url]);
118114
}
119115

120-
return $redirect;
116+
return $url instanceof SymfonyRedirect ? $url : Redirect::away($url);
121117
}
122118
}

0 commit comments

Comments
 (0)