@@ -165,14 +165,13 @@ public function setupDefault404Redirect()
165
165
$ dynamic_conf_path = $ this ->proxyPath ().'/dynamic ' ;
166
166
$ proxy_type = $ this ->proxyType ();
167
167
$ redirect_url = $ this ->proxy ->redirect_url ;
168
- ray ($ proxy_type );
169
168
if ($ proxy_type === ProxyTypes::TRAEFIK ->value ) {
170
169
$ default_redirect_file = "$ dynamic_conf_path/default_redirect_404.yaml " ;
171
- } elseif ($ proxy_type === ' CADDY ' ) {
170
+ } elseif ($ proxy_type === ProxyTypes:: CADDY -> value ) {
172
171
$ default_redirect_file = "$ dynamic_conf_path/default_redirect_404.caddy " ;
173
172
}
174
173
if (empty ($ redirect_url )) {
175
- if ($ proxy_type === ' CADDY ' ) {
174
+ if ($ proxy_type === ProxyTypes:: CADDY -> value ) {
176
175
$ conf = ':80, :443 {
177
176
respond 404
178
177
} ' ;
@@ -242,7 +241,7 @@ public function setupDefault404Redirect()
242
241
$ conf ;
243
242
244
243
$ base64 = base64_encode ($ conf );
245
- } elseif ($ proxy_type === ' CADDY ' ) {
244
+ } elseif ($ proxy_type === ProxyTypes:: CADDY -> value ) {
246
245
$ conf = ":80, :443 {
247
246
redir $ redirect_url
248
247
} " ;
@@ -258,9 +257,6 @@ public function setupDefault404Redirect()
258
257
"echo ' $ base64' | base64 -d | tee $ default_redirect_file > /dev/null " ,
259
258
], $ this );
260
259
261
- if (config ('app.env ' ) == 'local ' ) {
262
- ray ($ conf );
263
- }
264
260
if ($ proxy_type === 'CADDY ' ) {
265
261
$ this ->reloadCaddy ();
266
262
}
@@ -908,7 +904,7 @@ public function ip(): Attribute
908
904
{
909
905
return Attribute::make (
910
906
get: function ($ value ) {
911
- return preg_replace ('/[^0-9a-zA-Z.-]/ ' , '' , $ value );
907
+ return preg_replace ('/[^0-9a-zA-Z.:% -]/ ' , '' , $ value );
912
908
}
913
909
);
914
910
}
0 commit comments