plain 0.15.0__py3-none-any.whl → 0.16.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plain/debug.py +3 -2
- plain/internal/middleware/headers.py +6 -0
- {plain-0.15.0.dist-info → plain-0.16.1.dist-info}/METADATA +1 -1
- {plain-0.15.0.dist-info → plain-0.16.1.dist-info}/RECORD +7 -7
- {plain-0.15.0.dist-info → plain-0.16.1.dist-info}/WHEEL +0 -0
- {plain-0.15.0.dist-info → plain-0.16.1.dist-info}/entry_points.txt +0 -0
- {plain-0.15.0.dist-info → plain-0.16.1.dist-info}/licenses/LICENSE +0 -0
plain/debug.py
CHANGED
@@ -12,14 +12,15 @@ def dd(*objs):
|
|
12
12
|
|
13
13
|
Dump the object and raise a ResponseException with the dump as the response content.
|
14
14
|
"""
|
15
|
+
|
16
|
+
print(f"Dumping objects:\n{'\n'.join([pformat(obj) for obj in objs])}")
|
17
|
+
|
15
18
|
dump_strs = [
|
16
19
|
Markup("<pre><code>") + escape(pformat(obj)) + Markup("</code></pre>")
|
17
20
|
for obj in objs
|
18
21
|
]
|
19
22
|
combined_dump_str = Markup("\n\n").join(dump_strs)
|
20
23
|
|
21
|
-
print(f"Dumping objects:\n{combined_dump_str}")
|
22
|
-
|
23
24
|
response = Response()
|
24
25
|
response.status_code = 500
|
25
26
|
response.content = combined_dump_str
|
@@ -9,6 +9,12 @@ class DefaultHeadersMiddleware:
|
|
9
9
|
response = self.get_response(request)
|
10
10
|
|
11
11
|
for header, value in settings.DEFAULT_RESPONSE_HEADERS.items():
|
12
|
+
# Since we don't have a good way to *remote* default response headers,
|
13
|
+
# use allow users to set them to an empty string to indicate they should be removed.
|
14
|
+
if header in response.headers and response.headers[header] == "":
|
15
|
+
del response.headers[header]
|
16
|
+
continue
|
17
|
+
|
12
18
|
response.headers.setdefault(header, value)
|
13
19
|
|
14
20
|
# Add the Content-Length header to non-streaming responses if not
|
@@ -1,6 +1,6 @@
|
|
1
1
|
plain/README.md,sha256=mFsLBpqiHvuznV98eewupvo1JoQeQG0q87wNlXit21A,1695
|
2
2
|
plain/__main__.py,sha256=BiYbF-txGNbeRqp_CHQ9EZ_bCbbKq2iw51Z8RRUgIBY,105
|
3
|
-
plain/debug.py,sha256=
|
3
|
+
plain/debug.py,sha256=abPkJY4aSbBYGEYSZST_ZY3ohXPGDdz9uWQBYRqfd3M,730
|
4
4
|
plain/exceptions.py,sha256=pPAO8cIzNoqa2YrxG0d31C4P2V9SZ2OprHcjY9-qhIU,6332
|
5
5
|
plain/json.py,sha256=McJdsbMT1sYwkGRG--f2NSZz0hVXPMix9x3nKaaak2o,1262
|
6
6
|
plain/paginator.py,sha256=zCHCmCG8FEet6C28w2rUko9yiGFnOGCQxRbM_ssa9XY,6037
|
@@ -51,7 +51,7 @@ plain/internal/handlers/base.py,sha256=I6549DBZUb-anqox7arzL9wpypH4bUCxZkitO76hl
|
|
51
51
|
plain/internal/handlers/exception.py,sha256=DH9gh1FyqgetFpMaB8yLIVE6phBTVPKQLA1GIn9MOeI,4555
|
52
52
|
plain/internal/handlers/wsgi.py,sha256=EWoH9EeetfgiL0BtoAe2Aof0VWaBrxl74Y9EP4xx0wc,7553
|
53
53
|
plain/internal/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
54
|
-
plain/internal/middleware/headers.py,sha256=
|
54
|
+
plain/internal/middleware/headers.py,sha256=naYsFK0phMGFf1DlRj5fAYz78R5cXToCJfuqm0cR0nI,965
|
55
55
|
plain/internal/middleware/https.py,sha256=XpuQK8HicYX1jNanQHqNgyQ9rqe4NLUOZO3ZzKdsP8k,1203
|
56
56
|
plain/internal/middleware/slash.py,sha256=1rZsSSzXAA-vBb-dc2RlZaKW9gTT8YM8fJzwYGL4swA,2575
|
57
57
|
plain/logs/README.md,sha256=H6uVXdInYlasq0Z1WnhWnPmNwYQoZ1MSLPDQ4ZE7u4A,492
|
@@ -138,8 +138,8 @@ plain/views/forms.py,sha256=RhlaUcZCkeqokY_fvv-NOS-kgZAG4XhDLOPbf9K_Zlc,2691
|
|
138
138
|
plain/views/objects.py,sha256=fRfS6KNehIGqkbPw4nSafj8HStxYExHmbggolBbzcxs,7921
|
139
139
|
plain/views/redirect.py,sha256=KLnlktzK6ZNMTlaEiZpMKQMEP5zeTgGLJ9BIkIJfwBo,1733
|
140
140
|
plain/views/templates.py,sha256=nF9CcdhhjAyp3LB0RrSYnBaHpHzMfPSw719RCdcXk7o,2007
|
141
|
-
plain-0.
|
142
|
-
plain-0.
|
143
|
-
plain-0.
|
144
|
-
plain-0.
|
145
|
-
plain-0.
|
141
|
+
plain-0.16.1.dist-info/METADATA,sha256=GoCuu4bEkD-XaOiuI-fBcEhUpCYvl0Eb5iChNKN0AqA,2518
|
142
|
+
plain-0.16.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
143
|
+
plain-0.16.1.dist-info/entry_points.txt,sha256=DHHprvufgd7xypiBiqMANYRnpJ9xPPYhYbnPGwOkWqE,40
|
144
|
+
plain-0.16.1.dist-info/licenses/LICENSE,sha256=m0D5O7QoH9l5Vz_rrX_9r-C8d9UNr_ciK6Qwac7o6yo,3175
|
145
|
+
plain-0.16.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|