maticzav/nookies

Prevent setting headers on a finished response

Closed this issue ยท 13 comments

Currently, nookies does not check if the response is already finished in the setCookie method, which may create unwanted, and hard to debug errors. Could we make a simple check on res.finished in the setCookie logic?

I could propose a PR for this.

+1

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@sarneeh a PR sounds great! I'd be very happy to merge it.

+1 I'd love to get rid of Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client in my server logs

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hey ๐Ÿ‘‹ ,

I'd love to merge a PR if anyone has some spare time to implement it.

Hey @maticzav, sorry for the lack of activity, but I've had and still have a lot of work to do. Although I'll try to implement this in the next weekend!

@sarneeh any chance you were able to get to starting this PR? If not maybe I can try to contribute but I'm not sure I have the requisite knowledge to implement this

@devinhalladay Feel free to do it, you have my sword โš”๏ธ I can certainly find time to do a review of your PR. Won't be able to create one tho, as I'm still hard on time ๐Ÿ˜ญ

@maticzav I have prepared PR for this case. Please give me access to this repo.

@szczepanbarszczowski, please make a fork of the repository and collect the changes in a pull request. I am quite confident that you don't need any additional access to submit a pull request to this repository.

@szczepanbarszczowski thanks! I believe this issue may be closed now that we've merged the PR.

Please reopen it otherwise ๐Ÿ™‚