-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathHttp.php
executable file
·52 lines (48 loc) · 1.37 KB
/
Http.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Webiny Framework (http://www.webiny.com/framework)
*
* @copyright Copyright Webiny LTD
*/
namespace Webiny\Component\Http;
use Webiny\Component\Http\Session\Storage\NativeStorage;
use Webiny\Component\StdLib\ComponentTrait;
/**
* Http component.
* This class is only used to register the component configuration.
* To actually use the component use HttpTrait.
*
* @package Webiny\Component\Http
*/
class Http
{
use ComponentTrait;
/**
* Default component configuration
* @var array
*/
private static $defaultConfig = [
'Session' => [
'Storage' => [
'Driver' => NativeStorage::class,
'Prefix' => '',
'ExpireTime' => 86400
]
],
//'TrustedProxies' => ['127.0.0.1'],
'TrustedHeaders' => [
//'client_ip' => 'X_FORWARDED_FOR', # needs to be explicitly enabled because this can be a security issue
'client_host' => 'X_FORWARDED_HOST',
'client_proto' => 'X_FORWARDED_PROTO',
'client_port' => 'X_FORWARDED_PORT'
],
'Cookie' => [
'Storage' => [
'Driver' => Cookie\Storage\NativeStorage::class
],
'Prefix' => '',
'HttpOnly' => 'true',
'ExpireTime' => 86400
]
];
}