From 2341e9037dbe2f49dd838084647656319af41d15 Mon Sep 17 00:00:00 2001 From: Irfan Ahmad Date: Fri, 8 Feb 2013 17:04:55 +0500 Subject: [PATCH] Fixed #10 CSS references which started with ./ or ../ were failing --- mincss/processor.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/mincss/processor.py b/mincss/processor.py index c4f8dfa..a8cafc1 100644 --- a/mincss/processor.py +++ b/mincss/processor.py @@ -419,18 +419,7 @@ def __found(self, bodies, selector): return False def _make_absolute_url(self, url, href): - parsed = urlparse.urlparse(url) - if href.startswith('//'): - return parsed.scheme + ':' + href - if href.startswith('/'): - return parsed.scheme + '://' + parsed.netloc + href - if href.count('://'): - return href - path = parsed.path - parts = path.split('/') - parts[-1] = href - path = '/'.join(parts) - return parsed.scheme + '://' + parsed.netloc + path + return urlparse.urljoin(url, href) class _Result(object):