File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ // return [
6+ // 'rka' => [
7+ // 'ip_address' => [
8+ // 'check_proxy_headers' => false,
9+ // 'trusted_proxies' => [],
10+ // 'attribute_name' => 'ip_address',
11+ // 'headers_to_inspect' => [],
12+ // ],
13+ // ],
14+ // ];
15+
16+ return [
17+ 'rka ' => [
18+ 'ip_address ' => [
19+ 'check_proxy_headers ' => true ,
20+ 'trusted_proxies ' => [],
21+ 'attribute_name ' => 'ip_address ' ,
22+ 'headers_to_inspect ' => [
23+ 'Forwarded ' ,
24+ 'X-Forwarded-For ' ,
25+ 'X-Forwarded ' ,
26+ 'X-Cluster-Client-Ip ' ,
27+ 'Client-Ip ' ,
28+ ],
29+ ],
30+ ],
31+ ];
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -24,13 +24,13 @@ class PostCreateContactHandler implements RequestHandlerInterface
2424 TemplateRendererInterface::class,
2525 UrlHelper::class,
2626 ContactService::class,
27- 'config ' ,
27+ 'config.rka.ip_address ' ,
2828 )]
2929 public function __construct (
3030 protected TemplateRendererInterface $ template ,
3131 protected UrlHelper $ urlHelper ,
3232 protected ContactService $ contactService ,
33- protected array $ config ,
33+ protected array $ ipAddressConfig ,
3434 ) {
3535 }
3636
@@ -44,7 +44,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
4444 $ token = is_array ($ rawBody ) && is_string ($ rawBody ['cf-turnstile-response ' ] ?? null )
4545 ? $ rawBody ['cf-turnstile-response ' ]
4646 : '' ;
47- $ ip = $ request ->getAttribute ($ this ->config [ ' rka ' ][ ' ip_address ' ][ ' attribute_name ' ] ?? ' ip_address ' );
47+ $ ip = $ request ->getAttribute ($ this ->ipAddressConfig [ ' attribute_name ' ]);
4848
4949 if (! $ this ->contactService ->verifyTurnstile ($ token , $ ip )) {
5050 $ errors ['captcha ' ] = "We couldn't verify you're human. Please try again. " ;
You can’t perform that action at this time.
0 commit comments