Skip to content

Support ctx.respond = false - #95

Closed
nordsimon wants to merge 1 commit into
koajs:masterfrom
nordsimon:master
Closed

Support ctx.respond = false#95
nordsimon wants to merge 1 commit into
koajs:masterfrom
nordsimon:master

Conversation

@nordsimon

Copy link
Copy Markdown

Hi. First of all, thanks for koa. We did a very successful refactor from express to koa and our codebase is much slimmer, faster and easier to read.

Anyway, we have a very specific cache solution where we actually need to use the ctx.respond = false. I know it's unsupported and I understand why but we still want to use it in a very specific situation. I've managed to call the commit() command by getting the symbol from context but it tries another commit later in the codebase and there it emits an "Can't set headers after they are sent"

My solution to this would be to check for headerSent in commit to avoid this.

I know i'm in deep blue with features that are unsupported but this is the best way i could think of

@coveralls

coveralls commented Aug 21, 2017

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling bfca51f on nordsimon:master into 906277a on koajs:master.

@coveralls

coveralls commented Aug 21, 2017

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling bfca51f on nordsimon:master into 906277a on koajs:master.

@nordsimon

Copy link
Copy Markdown
Author

Closing this in favor of supporting it more widely in koa

@nordsimon nordsimon closed this Aug 21, 2017
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