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 55use PhpSpec \ObjectBehavior ;
66use Psr \Http \Message \RequestInterface ;
77
8- class HeaderHashGeneratorSpec extends ObjectBehavior
8+ class SharedCacheKeyGeneratorSpec extends ObjectBehavior
99{
1010 public function let ()
1111 {
@@ -14,7 +14,7 @@ public function let()
1414
1515 public function it_is_initializable ()
1616 {
17- $ this ->shouldHaveType ('Http\Client\Common\Plugin\Cache\Generator\HeaderHashGenerator ' );
17+ $ this ->shouldHaveType ('Http\Client\Common\Plugin\Cache\Generator\SharedCacheKeyGenerator ' );
1818 }
1919
2020 public function it_is_a_key_generator ()
Original file line number Diff line number Diff line change 55use Psr \Http \Message \RequestInterface ;
66
77/**
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 .
99 *
1010 * @author Tobias Nyholm <[email protected] > 1111 */
12- class HeaderHashGenerator implements CacheKeyGenerator
12+ class SharedCacheKeyGenerator implements CacheKeyGenerator
1313{
1414 /**
1515 * The header names we should take into account when creating the cache key.
@@ -19,9 +19,9 @@ class HeaderHashGenerator implements CacheKeyGenerator
1919 private $ headerNames ;
2020
2121 /**
22- * @param $headerNames
22+ * @param array $headerNames defaults to Authorization and Cookie
2323 */
24- public function __construct (array $ headerNames )
24+ public function __construct (array $ headerNames = [ ' Authorization ' , ' Cookie ' ] )
2525 {
2626 $ this ->headerNames = $ headerNames ;
2727 }
You can’t perform that action at this time.
0 commit comments