File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 5
5
use PhpSpec \ObjectBehavior ;
6
6
use Psr \Http \Message \RequestInterface ;
7
7
8
- class HeaderHashGeneratorSpec extends ObjectBehavior
8
+ class SharedCacheKeyGeneratorSpec extends ObjectBehavior
9
9
{
10
10
public function let ()
11
11
{
@@ -14,7 +14,7 @@ public function let()
14
14
15
15
public function it_is_initializable ()
16
16
{
17
- $ this ->shouldHaveType ('Http\Client\Common\Plugin\Cache\Generator\HeaderHashGenerator ' );
17
+ $ this ->shouldHaveType ('Http\Client\Common\Plugin\Cache\Generator\SharedCacheKeyGenerator ' );
18
18
}
19
19
20
20
public function it_is_a_key_generator ()
Original file line number Diff line number Diff line change 5
5
use Psr \Http \Message \RequestInterface ;
6
6
7
7
/**
8
- * Generate a cache key by specify what headers you want to vary on .
8
+ * Generate a cache key by vary on Cookie and Authorization header .
9
9
*
10
10
* @author Tobias Nyholm <[email protected] >
11
11
*/
12
- class HeaderHashGenerator implements CacheKeyGenerator
12
+ class SharedCacheKeyGenerator implements CacheKeyGenerator
13
13
{
14
14
/**
15
15
* The header names we should take into account when creating the cache key.
@@ -19,9 +19,9 @@ class HeaderHashGenerator implements CacheKeyGenerator
19
19
private $ headerNames ;
20
20
21
21
/**
22
- * @param $headerNames
22
+ * @param array $headerNames defaults to Authorization and Cookie
23
23
*/
24
- public function __construct (array $ headerNames )
24
+ public function __construct (array $ headerNames = [ ' Authorization ' , ' Cookie ' ] )
25
25
{
26
26
$ this ->headerNames = $ headerNames ;
27
27
}
You can’t perform that action at this time.
0 commit comments