Skip to content

Commit 4c69cfe

Browse files
committed
Updates
1 parent d01fccd commit 4c69cfe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mini_django.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ def view_fail(req: HttpRequest, code: str, failure: str) -> HttpResponse:
167167
res.write('<div><b>Response Code:</b> '+res.code+'</div>')
168168
res.write("</div><pre>")
169169
res.write("Valid paths: /dj4e /js4e or /404")
170-
res.write("\nRequest header data:")
171-
res.write(json.dumps(req.headers, indent=4))
170+
if isinstance(req, HttpRequest) :
171+
res.write("\nRequest header data:")
172+
res.write(json.dumps(req.headers, indent=4))
172173
res.write("</pre></body></html>")
173174
return res
174175

0 commit comments

Comments
 (0)