Merge branch 'trunk'

This commit is contained in:
Jérémy Munsch 2021-10-26 16:57:06 +02:00
commit eb0039653d
No known key found for this signature in database
GPG key ID: 55196BEE445F6049
4 changed files with 59 additions and 7 deletions

View file

@ -20,5 +20,9 @@ class TrustProxies extends Middleware
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
protected $headers = Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB;
}

53
config/trustedproxy.php Normal file
View file

@ -0,0 +1,53 @@
<?php
return [
/*
* Set trusted proxy IP addresses.
*
* Both IPv4 and IPv6 addresses are
* supported, along with CIDR notation.
*
* The "*" character is syntactic sugar
* within TrustedProxy to trust any proxy
* that connects directly to your server,
* a requirement when you cannot know the address
* of your proxy (e.g. if using ELB or similar).
*
*/
'proxies' => [
'192.168.31.9', // HA PROXY prod "Virtual IP"
'192.168.31.10', // HA PROXY prod "Virtual IP" redondance
'192.168.34.15' // HA PROXY dev "Virtual IP"
],
/*
* To trust one or more specific proxies that connect
* directly to your server, use an array or a string separated by comma of IP addresses:
*/
/*
* Or, to trust all proxies that connect
* directly to your server, use a "*"
*/
/*
* Which headers to use to detect proxy related data (For, Host, Proto, Port)
*
* Options include:
*
* - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust)
* - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust)
* - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB (If you are using AWS Elastic Load Balancer)
*
* - 'HEADER_X_FORWARDED_ALL' (use all x-forwarded-* headers to establish trust)
* - 'HEADER_FORWARDED' (use the FORWARDED header to establish trust)
* - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer)
*
* @link https://symfony.com/doc/current/deployment/proxies.html
*/
'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_FOR |
Illuminate\Http\Request::HEADER_X_FORWARDED_HOST |
Illuminate\Http\Request::HEADER_X_FORWARDED_PORT |
Illuminate\Http\Request::HEADER_X_FORWARDED_PROTO,
];

View file

@ -71,6 +71,6 @@
</th>
<th scope="col">
@if(session("crud.$modelTable.sort_way") and session("crud.$modelTable.sort_col"))
<a href="{{ request()->fullUrlWithQuery(['rst' => 'true','sort_col' => null, 'sort_way' => null]) }}" class="btn btn-small btn-danger">&#9003;</a>
<a href="{{ _genUrl(['rst' => 'true','sort_col' => null, 'sort_way' => null]) }}" class="btn btn-small btn-danger">&#9003;</a>
@endif
</th>

View file

@ -43,11 +43,6 @@
<thead class="thead-dark">
<tr>
@include('customer.index-tableHeaders')
<th scope="col">
@if(session("crud.$modelTable.sort_way") and session("crud.$modelTable.sort_col"))
<a href="{{ request()->fullUrlWithQuery(['rst' => 'true', 'sort_col' => null, 'sort_way' => null]) }}" class="btn btn-small btn-danger">&#9003;</a>
@endif
</th>
</tr>
</thead>
<tbody>