Skip to content

Commit 8730e67

Browse files
authored
Use getter method to retrieve except array (#41634)
Imagine somebody wants to dynamically set $except array in the middleware. Then they should do it in __construct(). But this way, they can easily override getExcludedPaths() to add their own functionality.
1 parent 19b0abf commit 8730e67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ protected function hasValidBypassCookie($request, array $data)
111111
*/
112112
protected function inExceptArray($request)
113113
{
114-
foreach ($this->except as $except) {
114+
foreach ($this->getExcludedPaths() as $except) {
115115
if ($except !== '/') {
116116
$except = trim($except, '/');
117117
}

0 commit comments

Comments
 (0)