git_webhooks/github.py: remove git url shortening
This commit is contained in:
parent
4a6037c774
commit
904cb2d94c
1 changed files with 4 additions and 9 deletions
|
@ -172,15 +172,10 @@ class GitHub(object):
|
||||||
return list(zip(out, [None]*len(out)))
|
return list(zip(out, [None]*len(out)))
|
||||||
|
|
||||||
def _short_url(self, url):
|
def _short_url(self, url):
|
||||||
self.log.debug("git.io shortening: %s" % url)
|
# TODO: find an alternative to git.io
|
||||||
try:
|
# see https://github.com/jesopo/bitbot/issues/338
|
||||||
page = utils.http.request("https://git.io", method="POST",
|
# ~ examknow 1/19/2022
|
||||||
post_data={"url": url})
|
return url
|
||||||
return page.headers["Location"]
|
|
||||||
except utils.http.HTTPTimeoutException:
|
|
||||||
self.log.warn(
|
|
||||||
"HTTPTimeoutException while waiting for github short URL", [])
|
|
||||||
return url
|
|
||||||
|
|
||||||
def _iso8601(self, s):
|
def _iso8601(self, s):
|
||||||
return utils.datetime.parse.iso8601(s)
|
return utils.datetime.parse.iso8601(s)
|
||||||
|
|
Loading…
Reference in a new issue