Skip to content

Commit 3e821c4

Browse files
committed
fix: set preview header for endpoints that require it only
1 parent 1b767b3 commit 3e821c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Github/Api/Repository/Protection.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public function configure()
3434
*/
3535
public function show($username, $repository, $branch)
3636
{
37+
// Preview endpoint
38+
$this->acceptHeaderValue = 'application/vnd.github.luke-cage-preview+json';
39+
3740
return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection');
3841
}
3942

@@ -51,6 +54,9 @@ public function show($username, $repository, $branch)
5154
*/
5255
public function update($username, $repository, $branch, array $params = [])
5356
{
57+
// Preview endpoint
58+
$this->acceptHeaderValue = 'application/vnd.github.luke-cage-preview+json';
59+
5460
return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches/'.rawurlencode($branch).'/protection', $params);
5561
}
5662

0 commit comments

Comments
 (0)