Skip to content

Commit

Permalink
Merge pull request #70 from zxv/fix-error-display-2
Browse files Browse the repository at this point in the history
Update error_status to HTTP status code 200 instead of 500, Update SASS error style
  • Loading branch information
dahlia committed May 15, 2015
2 parents f1eb543 + cc24ecc commit 6e1fcb6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/changes.rst
Expand Up @@ -8,6 +8,10 @@ To be released.

- Follow up the libsass upstream: 3.2.4 --- See the release notes of Libsass
3.2.3__, and 3.2.4__. [:issue:`69` by Anthony Sottile]
- The default value of :class:`~sassutils.wsgi.SassMiddleware`'s
``error_status`` parameter was changed from ``'500 Internal Server Error'``
to ``'200 OK'`` so that Mozilla Firefox can render the error message well.
[:issue:`67`, :issue:`68`, :issue:`70` by zxv]

__ https://github.com/sass/libsass/releases/tag/3.2.3
__ https://github.com/sass/libsass/releases/tag/3.2.4
Expand Down
6 changes: 4 additions & 2 deletions sassutils/wsgi.py
Expand Up @@ -92,7 +92,7 @@ class SassMiddleware(object):
"""

def __init__(self, app, manifests, package_dir={},
error_status='500 Internal Server Error'):
error_status='200 OK'):
if not callable(app):
raise TypeError('app must be a WSGI-compliant callable object, '
'not ' + repr(app))
Expand Down Expand Up @@ -143,7 +143,9 @@ def __call__(self, environ, start_response):
b'/*\n', str(e).encode('utf-8'), b'\n*/\n\n',
b'body:before { content: ',
self.quote_css_string(str(e)).encode('utf-8'),
b'; color: maroon; background-color: white; }'
b'; color: maroon; background-color: white',
b'; white-space: pre-wrap; display: block; ',
b'font-family: "Courier New", monospace; user-select: text; }'
]

def read_file(path):
Expand Down

0 comments on commit 6e1fcb6

Please sign in to comment.