Skip to content

Added support to not send responses when the handler has already called finish() - #100

Closed
vivekfantain wants to merge 1 commit into
hfaran:masterfrom
vivekfantain:master
Closed

Added support to not send responses when the handler has already called finish()#100
vivekfantain wants to merge 1 commit into
hfaran:masterfrom
vivekfantain:master

Conversation

@vivekfantain

Copy link
Copy Markdown

I ran into this problem when I wanted to implement HTTP 304 for some of my JSON get APIs. I did a self.set_header(304) and self.finish() that broke tornado which complained that we are writing a response after finish(). So I have modified JSendMixin to not send a response if the finish is already called. Unfortunately this relies on Tornado's internal '_finish' flag which is not exposed outside.

…y called finished(). This is useful for HTTP 304 implementation
@hfaran

hfaran commented May 11, 2018

Copy link
Copy Markdown
Owner

Thanks for the patch. Can you fix the unit tests that are failing as well? You just need to update the mock mixin.

@hfaran

hfaran commented Apr 17, 2019

Copy link
Copy Markdown
Owner

Superseded by #108, closing this

@hfaran hfaran closed this Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants