Fix github API requests after asset upload (#771)

In the old code the self.__hostname would be overwritten with uploads.github.com
but it could not be correctly re-set to api.github.com after completing the upload
Create a separate connection if hostname or port differ in requestBlobAndCheck

in the end this became quite a large overhaul, to also make this change generic
for e.g. connecting to status.github.com and similar methods

~~not sure if tests need (more) updating, if so I will update the PR accordingly~~
This commit is contained in:
Maarten Fonville
2018-06-22 12:46:46 +08:00
committed by Wan Liuyang
parent e389396405
commit 8bdac23ca1
6 changed files with 32 additions and 26 deletions
@@ -265,7 +265,7 @@ None
https
GET
status.github.com
443
None
/api/status.json
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
@@ -276,7 +276,7 @@ None
https
GET
status.github.com
443
None
/api/last-message.json
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
@@ -1,7 +1,7 @@
https
GET
status.github.com
443
None
/api/last-message.json
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
@@ -1,7 +1,7 @@
https
GET
status.github.com
443
None
/api/messages.json
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
@@ -1,7 +1,7 @@
https
GET
status.github.com
443
None
/api/status.json
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None