Skip to content

Commit 6e1fcb6

Browse files
committed
Merge pull request #70 from zxv/fix-error-display-2
Update error_status to HTTP status code 200 instead of 500, Update SASS error style
2 parents f1eb543 + cc24ecc commit 6e1fcb6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/changes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ To be released.
88

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

1216
__ https://github.com/sass/libsass/releases/tag/3.2.3
1317
__ https://github.com/sass/libsass/releases/tag/3.2.4

sassutils/wsgi.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class SassMiddleware(object):
9292
"""
9393

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

149151
def read_file(path):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy