diff --git a/src/url_shortener/shorteners/url_shortener.py b/src/url_shortener/shorteners/url_shortener.py index f825af0f..3335b1eb 100644 --- a/src/url_shortener/shorteners/url_shortener.py +++ b/src/url_shortener/shorteners/url_shortener.py @@ -21,7 +21,7 @@ class URLShortener (object): def unshorten(self, url): try: - r=requests.head(url, allow_redirects=True) - return r.url + r=requests.head(url) + return r.headers['location'] except: return url #we cannot expand