FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: prevent writing after response headers are sent by hata6502 · Pull Request #163 · pillarjs/finalhandler · GitHub

fix: prevent writing after response headers are sent - #163

Open
hata6502 wants to merge 2 commits into
pillarjs:masterfrom
hata6502:fix/headers-sent-after-request-finish
Open

fix: prevent writing after response headers are sent#163
hata6502 wants to merge 2 commits into
pillarjs:masterfrom
hata6502:fix/headers-sent-after-request-finish

Conversation

Copy link
Copy Markdown

Fixes #162

Changes

Check res.headersSent at the beginning of the write() callback invoked by onFinished.

If the response headers have already been sent, stop without writing to the response. This prevents finalhandler from modifying a response sent by another operation and avoids ERR_HTTP_HEADERS_SENT.

The existing behavior of reading the complete request body remains unchanged.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

ERR_HTTP_HEADERS_SENT when headers are sent while finalhandler waits for the request to finish

1 participant


Back | FazBrowse Home | New Git URL