Skip to content

Commit 876719b

Browse files
committed
- Added support for removing auth header
1 parent 3e64fc1 commit 876719b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/IPub/JsonAPIClient/Clients/GuzzleClient.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,16 @@ public function addAuthorization(string $token) : void
169169
$this->addHeader('Authorization', 'Bearer ' . $token);
170170
}
171171

172+
/**
173+
* {@inheritdoc}
174+
*/
175+
public function removeAuthorization() : void
176+
{
177+
if (isset($this->headers['Authorization'])) {
178+
unset($this->headers['Authorization']);
179+
}
180+
}
181+
172182
/**
173183
* {@inheritdoc}
174184
*/

src/IPub/JsonAPIClient/Clients/IClient.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ public function addApiKey(string $key) : void;
104104
*/
105105
public function addAuthorization(string $token) : void;
106106

107+
/**
108+
* @return void
109+
*/
110+
public function removeAuthorization() : void;
111+
107112
/**
108113
* @param string $header
109114
* @param string $value

0 commit comments

Comments
 (0)