Skip to content

Commit 3e23871

Browse files
committed
fix __globals__ example
1 parent 192b4ad commit 3e23871

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/__globals__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ async def _on_request(self, **server):
2626
async def _on_response(self, **server):
2727
response = server['response']
2828

29-
del response.headers[b'x-debug']
29+
if not response.headers_sent():
30+
del response.headers[b'x-debug']
3031

3132

3233
app.logger.info('entering %s', __file__)

0 commit comments

Comments
 (0)