Skip to content
Permalink
Browse files

Check HTTP status of minifying tools

  • Loading branch information
da2x committed Nov 19, 2015
1 parent dbb28e9 commit 36f5e4dc185bab37914db50c33b51bb06eea6570
Showing with 7 additions and 0 deletions.
  1. +1 −0 CHANGES.txt
  2. +6 −0 nikola/filters.py
@@ -9,6 +9,7 @@ Features
Bugfixes
--------

* Check HTTP response status of minifying tools and skip them if they’re unavailable
* Change rewrite rule for fragment-only links (Issue #2132)
* Mention disabled plugins in ``nikola plugin --list-installed`` (Issue #2139)
* Don't examine all gallery image dates every build (Issue #2160)
@@ -290,6 +290,9 @@ def cssminify(data):
url = 'http://cssminifier.com/raw'
_data = {'input': data}
response = requests.post(url, data=_data)
if response.status_code != 200:
LOGGER.error("can't use cssminifier.com: HTTP status {}", response.status_code)
return data
return response.text
except Exception as exc:
LOGGER.error("can't use cssminifier.com: {}", exc)
@@ -303,6 +306,9 @@ def jsminify(data):
url = 'http://javascript-minifier.com/raw'
_data = {'input': data}
response = requests.post(url, data=_data)
if response.status_code != 200:
LOGGER.error("can't use javascript-minifier.com: HTTP status {}", response.status_code)
return data
return response.text
except Exception as exc:
LOGGER.error("can't use javascript-minifier.com: {}", exc)

0 comments on commit 36f5e4d

Please sign in to comment.
You can’t perform that action at this time.