Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit12b0df2

Browse files
committed
Merge pull requestsigmavirus24#316 from rweald/stop_using_deployment_headers
Don't use custom header for Deployment requests
2 parents84bb636 +f79febb commit12b0df2

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
classDeployment(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
returnself._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
returni
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
returnself._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
returni
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
deftest_events(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp