Skip to content

Commit 1c10e4f

Browse files
Return 500 http error, instead of 200, when dotenv fails to load (#45235)
* Return 500 http error, instead of 200 When dotenv fails, the response on http is always 200. Because of 200 response, alerts might not be triggered, and data will be cached :( * Update LoadEnvironmentVariables.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent f72d9eb commit 1c10e4f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Illuminate/Foundation/Bootstrap/LoadEnvironmentVariables.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ protected function writeErrorAndDie(InvalidFileException $e)
103103
$output->writeln('The environment file is invalid!');
104104
$output->writeln($e->getMessage());
105105

106+
http_response_code(500);
107+
106108
exit(1);
107109
}
108110
}

0 commit comments

Comments
 (0)