René's URL Explorer Experiment


Title: HTTP parser premature close · Issue #29609 · nodejs/node · GitHub

Open Graph Title: HTTP parser premature close · Issue #29609 · nodejs/node

X Title: HTTP parser premature close · Issue #29609 · nodejs/node

Description: Version: v12.10.0 Platform: macOS Subsystem: http, stream I'm running across an issue where when no response data is written during the "request" event call, the HTTP handling either closes the response without sending any apparent reply...

Open Graph Description: Version: v12.10.0 Platform: macOS Subsystem: http, stream I'm running across an issue where when no response data is written during the "request" event call, the HTTP handling either closes the res...

X Description: Version: v12.10.0 Platform: macOS Subsystem: http, stream I'm running across an issue where when no response data is written during the "request" event call, the HTTP handling either ...

Opengraph URL: https://github.com/nodejs/node/issues/29609

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"HTTP parser premature close","articleBody":"\u003c!--\r\nThank you for reporting a possible bug in Node.js.\r\n\r\nPlease fill in as much of the template below as you can.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)\r\nSubsystem: if known, please specify the affected core module name\r\n\r\nIf possible, please provide code that demonstrates the problem, keeping it as\r\nsimple and free of external dependencies as you can.\r\n--\u003e\r\n\r\n* **Version**: v12.10.0\r\n* **Platform**: macOS\r\n* **Subsystem**: http, stream\r\n\r\n\u003c!-- Please provide more details below this comment. --\u003e\r\n\r\n\r\nI'm running across an issue where when no response data is written during the \"request\" event call, the HTTP handling either closes the response without sending any apparent reply, or sends a `Connection: close` response but doesn't end the stream.\r\n\r\nThis is a strange behavior that I can't find an explanation for and I can't come up with any workaround; so I think this is a bug.\r\n\r\n**Case 1**\r\n\r\n```javascript\r\n\"use strict\";\r\nconst http = require('http');\r\nconst makeDuplexPair = require('./test/common/duplexpair.js');\r\n\r\nconst message = 'GET / HTTP/1.1\\r\\nHost: example.com\\r\\nConnection: close\\r\\n\\r\\n';\r\nconst server = http.createServer(function(req, res){\r\n\tconsole.log('Have request: ', req.method, req.url);\r\n\treq.resume();\r\n\treq.once('end', function(){\r\n\t\tconsole.log('(request end)');\r\n\t\tres.end('Fin\\r\\n');\r\n\t});\r\n});\r\n\r\nconst {clientSide, serverSide} = makeDuplexPair();\r\nclientSide.end(message);\r\nclientSide.pipe(process.stdout);\r\nclientSide.once('end', function(){ console.log('(Connection closed)'); });\r\n\r\nserver.emit('connection', serverSide);\r\n```\r\n\r\nActual:\r\n```\r\nHave request:  GET /\r\n(request end)\r\n(Connection closed)\r\n```\r\n\r\nI expect to see the HTTP response output, but the connection simply closes.\r\n\r\n\r\n**Case 2** (using clientSide.write instead of clientSide.end)\r\n```javascript\r\n\"use strict\";\r\nconst http = require('http');\r\nconst makeDuplexPair = require('./test/common/duplexpair.js');\r\n\r\nconst message = 'GET / HTTP/1.1\\r\\nHost: example.com\\r\\nConnection: close\\r\\n\\r\\n';\r\nconst server = http.createServer(function(req, res){\r\n\tconsole.log('Have request: ', req.method, req.url);\r\n\treq.resume();\r\n\treq.once('end', function(){\r\n\t\tconsole.log('(request end)');\r\n\t\tres.end('Fin\\r\\n');\r\n\t});\r\n});\r\n\r\nconst {clientSide, serverSide} = makeDuplexPair();\r\nclientSide.write(message);\r\nclientSide.pipe(process.stdout);\r\nclientSide.once('end', function(){ console.log('(Connection closed)'); });\r\n\r\nserver.emit('connection', serverSide);\r\n```\r\n\r\nI expect to see `(Connection closed)` at the end, but I do not.\r\n\r\nActual:\r\n```\r\nHave request:  GET /\r\n(request end)\r\nHTTP/1.1 200 OK\r\nDate: Thu, 19 Sep 2019 01:01:49 GMT\r\nConnection: close\r\nContent-Length: 5\r\n\r\nFin\r\n```\r\n\r\n\r\nIn one or the other case I expect:\r\n```\r\nHave request:  GET /\r\n(request end)\r\nHTTP/1.1 200 OK\r\nDate: Thu, 19 Sep 2019 01:01:49 GMT\r\nConnection: close\r\nContent-Length: 5\r\n\r\nFin\r\n(Connection closed)\r\n```\r\n\r\nAs far as I can tell, there's no way to do this.","author":{"url":"https://github.com/awwright","@type":"Person","name":"awwright"},"datePublished":"2019-09-19T01:04:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/29609/node/issues/29609"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ce459695-d458-f111-e40f-a4b912928bf9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCC98:FE029:374790E:4F24EB0:6A4FD5A2
html-safe-noncecfee4fd1df0759a1d4cafff9f4ebd680c9bbb974e58832ad2017ade32b1c700d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzk4OkZFMDI5OjM3NDc5MEU6NEYyNEVCMDo2QTRGRDVBMiIsInZpc2l0b3JfaWQiOiI2ODk0NjAwODQwNDM2MjQxODI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacf2d3cd761fe1285c82092f342482ec82b06216dfe83e9a567698ee0aef408ab3
hovercard-subject-tagissue:495521369
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/29609/issue_layout
twitter:imagehttps://opengraph.githubassets.com/038310f7f727bd09905a288cf69068c8e0f5775e52239cc434d3f7690190f640/nodejs/node/issues/29609
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/038310f7f727bd09905a288cf69068c8e0f5775e52239cc434d3f7690190f640/nodejs/node/issues/29609
og:image:altVersion: v12.10.0 Platform: macOS Subsystem: http, stream I'm running across an issue where when no response data is written during the "request" event call, the HTTP handling either closes the res...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameawwright
hostnamegithub.com
expected-hostnamegithub.com
None19b98c3d9767bb8a56238a89ff8401d1cbdf3bc5c353799aacf49fe6c76b4b7c
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release142593e66413bbae27fd485859993597d5a3b104
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/issues/29609#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F29609
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F29609
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/29609
Reloadhttps://github.com/nodejs/node/issues/29609
Reloadhttps://github.com/nodejs/node/issues/29609
Please reload this pagehttps://github.com/nodejs/node/issues/29609
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/issues/29609
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.3k https://github.com/nodejs/node/issues
Pull requests 973 https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality 0 https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Code https://github.com/nodejs/node
Issues https://github.com/nodejs/node/issues
Pull requests https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
HTTP parser premature closehttps://github.com/nodejs/node/issues/29609#top
httpIssues or PRs related to the http subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%22
https://github.com/awwright
awwrighthttps://github.com/awwright
on Sep 19, 2019https://github.com/nodejs/node/issues/29609#issue-495521369
httpIssues or PRs related to the http subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22http%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.