Skip to content

Commit f79febb

Browse files
committed
Don't use custom header for Deployment requests
1 parent 36b4a67 commit f79febb

File tree

5 files changed

+6
-16
lines changed

5 files changed

+6
-16
lines changed

AUTHORS.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,5 @@ Contributors
8282
- Adrian Moisey (@adrianmoisey)
8383

8484
- Bryce Boe (@bboe)
85+
86+
- Ryan Weald (@rweald)

github3/repos/deployment.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66

77

88
class Deployment(GitHubCore):
9-
CUSTOM_HEADERS = {
10-
'Accept': 'application/vnd.github.cannonball-preview+json'
11-
}
12-
139
def _update_attributes(self, deployment):
1410
self._api = deployment.get('url')
1511

@@ -67,8 +63,7 @@ def create_status(self, state, target_url=None, description=None):
6763
data = {'state': state, 'target_url': target_url,
6864
'description': description}
6965
self._remove_none(data)
70-
response = self._post(self.statuses_url, data=data,
71-
headers=Deployment.CUSTOM_HEADERS)
66+
response = self._post(self.statuses_url, data=data)
7267
json = self._json(response, 201)
7368

7469
return self._instance_or_null(DeploymentStatus, json)
@@ -84,7 +79,6 @@ def statuses(self, number=-1, etag=None):
8479
"""
8580
i = self._iter(int(number), self.statuses_url, DeploymentStatus,
8681
etag=etag)
87-
i.headers = Deployment.CUSTOM_HEADERS
8882
return i
8983

9084

github3/repos/repo.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,7 @@ def create_deployment(self, ref, force=False, payload='',
724724
'auto_merge': auto_merge, 'description': description,
725725
'environment': environment}
726726
self._remove_none(data)
727-
headers = Deployment.CUSTOM_HEADERS
728-
json = self._json(self._post(url, data=data, headers=headers),
727+
json = self._json(self._post(url, data=data),
729728
201)
730729
return self._instance_or_null(Deployment, json)
731730

@@ -1091,7 +1090,6 @@ def deployments(self, number=-1, etag=None):
10911090
"""
10921091
url = self._build_url('deployments', base_url=self._api)
10931092
i = self._iter(int(number), url, Deployment, etag=etag)
1094-
i.headers.update(Deployment.CUSTOM_HEADERS)
10951093
return i
10961094

10971095
@requires_auth

tests/unit/test_repos_deployment.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,5 @@ def test_statuses(self):
6464
self.session.get.assert_called_once_with(
6565
url_for('statuses'),
6666
params={'per_page': 100},
67-
headers={
68-
'Accept': 'application/vnd.github.cannonball-preview+json'
69-
}
67+
headers={}
7068
)

tests/unit/test_repos_repo.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,7 @@ def test_deployments(self):
384384
self.session.get.assert_called_once_with(
385385
url_for('deployments'),
386386
params={'per_page': 100},
387-
headers={
388-
'Accept': 'application/vnd.github.cannonball-preview+json'
389-
}
387+
headers={}
390388
)
391389

392390
def test_events(self):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy