Page MenuHomeDevCentral

D426.diff
No OneTemporary

D426.diff

diff --git a/app/Enums/TrustProxyConfigurationMode.php b/app/Enums/TrustProxyConfigurationMode.php
--- a/app/Enums/TrustProxyConfigurationMode.php
+++ b/app/Enums/TrustProxyConfigurationMode.php
@@ -8,9 +8,7 @@
* @method static TrustProxyConfigurationMode ENUM()
*/
class TrustProxyConfigurationMode extends Enum {
- const __default = self::TrustNone;
-
- const TrustNone = 0;
- const TrustSome = 1;
- const TrustAll = 2;
+ const TRUST_NONE = 0;
+ const TRUST_SOME = 1;
+ const TRUST_ALL = 2;
}
diff --git a/app/Http/Middleware/TrustProxy.php b/app/Http/Middleware/TrustProxy.php
--- a/app/Http/Middleware/TrustProxy.php
+++ b/app/Http/Middleware/TrustProxy.php
@@ -22,14 +22,14 @@
$proxy = Config::get('app.proxy');
switch ($mode = self::getConfigurationMode($proxy)) {
- case TrustProxyConfigurationMode::TrustNone:
+ case TrustProxyConfigurationMode::TRUST_NONE:
break;
- case TrustProxyConfigurationMode::TrustSome:
+ case TrustProxyConfigurationMode::TRUST_SOME:
$request->setTrustedProxies($proxy);
break;
- case TrustProxyConfigurationMode::TrustAll:
+ case TrustProxyConfigurationMode::TRUST_ALL:
$remoteAddr = $request->server->get('REMOTE_ADDR');
$request->setTrustedProxies([ '127.0.0.1', $remoteAddr ]);
break;
@@ -46,13 +46,13 @@
*/
public static function getConfigurationMode ($configValue) {
if (!is_array($configValue) || !count($configValue)) {
- return TrustProxyConfigurationMode::TrustNone;
+ return TrustProxyConfigurationMode::TRUST_NONE;
}
if (in_array('*', $configValue)) {
- return TrustProxyConfigurationMode::TrustAll;
+ return TrustProxyConfigurationMode::TRUST_ALL;
}
- return TrustProxyConfigurationMode::TrustSome;
+ return TrustProxyConfigurationMode::TRUST_SOME;
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 22:16 (19 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2309924
Default Alt Text
D426.diff (1 KB)

Event Timeline