File tree Expand file tree Collapse file tree
packages/http/src/Response Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,13 +19,15 @@ class RedirectResponse extends Response
1919 /**
2020 * Constructor.
2121 *
22- * @param string|Stringable $uri The redirect uri.
23- * @param int $status The status code.
24- * @param array $headers The custom headers.
22+ * @param string|Stringable|null $uri The redirect uri.
23+ * @param int $status The status code.
24+ * @param array $headers The custom headers.
2525 */
26- public function __construct (string |Stringable $ uri , int $ status = 303 , array $ headers = [])
26+ public function __construct (string |Stringable | null $ uri = null , int $ status = 303 , array $ headers = [])
2727 {
28- $ headers ['location ' ] = [(string ) $ uri ];
28+ if ($ uri !== null ) {
29+ $ headers ['location ' ] = [(string ) $ uri ];
30+ }
2931
3032 parent ::__construct (new NullStream (), $ status , $ headers );
3133 }
You can’t perform that action at this time.
0 commit comments