Use express response methods#2842
Conversation
We should not bypass the express conventions here. Doing so prevents other middleware from working as intended. This includes `graphql-upload`, which is currently unable to force the response to wait for the request to be fully consumed, and causes severe bugs, including locking a browser out of subsequent requests to the server. See: jaydenseric/graphql-upload#152 (comment)
|
Does this also need to be fixed in the other middleware packages such as |
|
The koa middle correctly follows the koa convention of using However, all of the upload middleware that are build in to the various I created issue #2843 for this separate, larger problem. |
abernix
left a comment
There was a problem hiding this comment.
LGTM / Thanks, @mike-marcacci. I certainly agree that using send here is more appropriate.
I've added a commit which falls back to calling end when send isn't available, which should satisfy connect's desires (and if tests are any barometer, the additional commit has resolved the failures).
As you've noted in your other PR, there's certainly room for additional improvement here, and while this code has gone relatively unchanged for almost 3 years, this change should still be an improvement worth getting in ASAP.
We should not bypass the express convention of using
res.sendhere. Doing so prevents other middleware from working as intended.This includes
graphql-upload, which is currently unable to force the response to wait for the request to be fully consumed, and causes severe bugs, including locking a browser out of subsequent requests to the server.Please see this issue and the accompanying demonstration repo put together with heroic effort by @juona.