GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — The differences between http2 compatibility API and http[s] · Issue #29829 · nodejs/node

The differences between http2 compatibility API and http[s] #29829

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
The differences between http2 compatibility API and http[s]#29829
Copy link
Labels
httpIssues and PRs related to the http subsystem.http2Issues and PRs related to the http2 subsystem.httpsIssues and PRs related to the https subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

Description

@sogaani
sogaani
opened on Oct 3, 2019
Issue body actions

Thanks to the efforts of making the compatibility API, differences between http[s] and http2 modules seldom annoy developers.
But, some http2 compatibility API still behaves differently and lacks some APIs from http[s] and it causes breakages to ecosystems for http[s](e.g. expressjs/express#3730).

In order to expose the differences, I've been translating test cases for http[s] to test cases for http2 at my repo. The following is a list of the differences currently founded by translated test cases.

I'm not sure all the differences have to be fixed. I thought if they should not be fixed, documenting the differences is good for the developer.

Differences between http and http2 compatibility API

  • http2.Http2ServerRequest does not have req.connection.bytesWritten. test:parallel/test-http-byteswritten.js,parallel/test-https-byteswritten.js
  • If http2.Http2ServerRequest.pause is called, http2.Http2ServerRequest.socket never emit 'data' event. test:parallel/test-http-dump-req-when-res-ends.js
  • http2.Http2ServerResponse.writeHead with 'HTTP/1 Connection specific headers'(e.g. "Transfer-Encoding":"chunked") causes error:ERR_HTTP2_INVALID_CONNECTION_HEADERS. test:parallel/test-http-head-request.js
  • http2.Http2ServerResponse does not have res.writeProcessing. test:parallel/test-http-information-processing.js
  • http2.Http2ServerResponse.writeHead with a spaced header name does not cause error. test:parallel/test-http-invalidheaderfield.js
  • http2.Http2ServerRequest does not have req.connection.parser. test:parallel/test-http-highwatermark.js,parallel/test-http-server-keepalive-end.js
  • http2.Http2ServerResponse.end calls callback before satisfying condition of 'finish' events. test:parallel/test-http-outgoing-finish.js
  • http2.Http2ServerResponse.getHeaders returns headers which is not initialized by Object.create(null)
    test:parallel/test-http-mutable-headers.js
  • http2.Http2ServerResponse does not have res.writableHighWaterMark. test:parallel/test-http-outgoing-properties.js related issue:http: OutgoingMessage streamlike #28969
  • http2.Http2ServerResponse does not have res.writableLength. test:parallel/test-http-outgoing-properties.js related issue:http: OutgoingMessage streamlike #28969
  • http2.Http2ServerResponse does not have res.writableFinished. test:parallel/test-http-outgoing-writableFinished.js related issue:http2 compat missing writableFinished #29230
  • http2.Http2ServerRequest.headers returns headers which is initialized by Object.create(null)
    test:parallel/test-http-raw-headers.js
  • http2.Http2ServerResponse.removeHeader cannot remove a header nodejs automatically adds(e.g. 'date'). test:parallel/test-http-remove-header-stays-removed.js
  • http2.Http2ServerResponse.write after http2.Http2ServerResponse.end returns false. test:parallel/test-http-res-write-after-end.js
  • http2.Http2ServerResponse.write after http2.Http2ServerResponse.end does not emmit 'error'. test:parallel/test-http-res-write-after-end.js,parallel/test-http-server-write-after-end.js Fixed by http2: make http2/compat.write more http/1 compliant #30964
  • http2.Http2ServerResponse.write with array input does not cause an error. test:parallel/test-http-res-write-after-end.js
  • http2.Http2ServerResponse.end with array input does not cause an error. test:parallel/test-http-res-write-after-end.js
  • http2.Http2ServerResponse's error code start with 'ERR_HTTP2'. test:parallel/test-http-response-add-header-after-sent.js,parallel/test-http-response-remove-header-after-sent.js,parallel/test-http-response-statuscode.js,parallel/test-http-write-head.js
  • http2.Http2ServerResponse.setHeader and http2.Http2ServerResponse.writeHead with multiple value of 'content-length' causes an error. test:parallel/test-http-response-multi-content-length.js
  • http2.Http2ServerResponse.setHeader and http2.Http2ServerResponse.writeHead with multiple value of 'content-type' or other headers expected single value causes an error. test:parallel/test-http-response-multiheaders.js
  • http2.Http2ServerResponse.writeHead with invalid character does not cause error. test:parallel/test-http-response-splitting.js
  • http2.Http2ServerResponse sending 'Trailer' header without 'transfer encoding: chunked' does not cause error. test:parallel/test-http-server-de-chunked-trailer.js
  • http2.Http2ServerResponse.writeHead cannot set multiple value of header with nested array. test:parallel/test-http-set-cookies.js
  • http2.Http2ServerResponse.setTimeout does not pass a socket to cb function. test:parallel/test-http-set-timeout-server.js
  • http2.Http2ServerResponse.writeHead with invalid status message does not cause an error. test:parallel/test-http-status-reason-invalid-chars.js
  • stream.pipe(http2.Http2ServerResponse) eventually emmits both 'finish' and 'close' events. test:parallel/test-http-writable-true-after-close.js
  • http2.Http2ServerResponse.end does not execute callback when http2.Http2ServerResponse.end has already been called. test:parallel/test-http-outgoing-end-multiple.js related PR:[x] http2: compat ERR_STREAM_ALREADY_FINISHED #29229
  • After http2.Http2ServerRequest.connection.setTimeout is called, 'timeout' event is not emitted. test:parallel/test-http-set-timeout.js
  • http2.Http2ServerResponse.finished turn true without calling end.
    http2: make compat finished match http/1 #24347
  • http2.Http2ServerResponse.write throw err when connection is invalid. http1 do nothing then.
    HTTP2 compatibility layer issues with invalid streams #29529
  • compat mode http2.Http2Server emits error when a connection is unexpectedly closed. In that case, http1.Server emits aborted. http2: sessionError vs aborted #28267
  • http2.Http2ServerResponse.write(data) after http2.Http2ServerResponse.writeHead()
    with status 304 or 204 cause error. Fix usage of undocumented _implicitHeader expressjs/compression#128 (comment)
Reacted by qdevial, Gary Crye, GrosSacASacs, Ivan Pegashev, Aphix, Robert Nagy, Miroslav Bajtoš, Bernardo A. Dal Corno, Pranshu Srivastava, Ruben Bridgewater and 9 more
Reacted by Anna Henningsen, Pranshu Srivastava, Andrei Pechkurov, ulrichb, Suman Kundu, Mikhail Shustov and Sebastian Plaza
Reacted by Bùi Quang Đức Tri

Activity

Next
  1. ZYSzys
    added
    httpIssues and PRs related to the http subsystem.
    http2Issues and PRs related to the http2 subsystem.
    httpsIssues and PRs related to the https subsystem.
    on Oct 3, 2019
  2. ronag commented on Dec 14, 2019

    @ronag
    ronag
    on Dec 14, 2019
    Member
    More actions

    I think you can add #24347 to the list as well.

  3. ronag commented on Dec 14, 2019

    @ronag
    ronag
    on Dec 14, 2019
    Member
    More actions

    Really good work! I would be interested in helping sorting some of this.

  4. ronag commented on Dec 14, 2019

    @ronag
    ronag
    on Dec 14, 2019
    Member
    More actions

    @sogaani I would like to suggest we put your tests in under tests/known_issues so that we might sort them out later? @addaleax would you agree?

  5. ronag commented on Dec 14, 2019

    @ronag
    ronag
    on Dec 14, 2019
    Member
    More actions

    Here is another one that might be worth to add to the list, #29529

  6. sogaani commented on Dec 15, 2019

    @sogaani
    sogaani
    on Dec 15, 2019
    Author
    More actions

    @ronag Thank you for looking at this issue. I added 2 issues you mentioned.

    I'm glad to make pull request to put my tests at this repo if it is OK.

  7. ronag commented on Dec 17, 2019

    @ronag
    ronag
    on Dec 17, 2019
    Member
    More actions

    @addaleax Some guidance here? Would it make sense to add @sogaani's test in e.g. known_issues? Sorting all these out will probably take a while and I'd like to avoid losing this excellent work.

  8. ronag commented on Jan 16, 2020

    @ronag
    ronag
    on Jan 16, 2020
    Member
    More actions

    @sogaani: Another candidate for the list #28267

  9. ronag commented on Jan 26, 2020

    @ronag
    ronag
    on Jan 26, 2020
    Member
    More actions

    @sogaani: Just wanted to give a quick ping that I'm still interested in helping sorting these out over time (a little swamped at the moment). But please do continue updating the list if you find more differences.

  10. sogaani commented on Jan 27, 2020

    @sogaani
    sogaani
    on Jan 27, 2020
    Author
    More actions

    @ronag Thank you for mentioning the difference. I added :)

    Reacted by Robert Nagy
  11. ronag commented on Apr 17, 2020

    @ronag
    ronag
    on Apr 17, 2020
    Member
    More actions

    @rexagod: If you are looking for tasks there is plenty to pick from here.

    Reacted by Pranshu Srivastava
  12. rexagod commented on Apr 17, 2020

    @rexagod
    rexagod
    on Apr 17, 2020
    Member
    More actions

    Awesome! Thank you for pointing me here, @ronag!

    Reacted by Robert Nagy and Aphix
  13. 67 remaining items

  14. codebytere
    added 3 commits that reference this issue on Jul 8, 2020

    http2: use `Object.create(null)` for `getHeaders`

    a3b7e59

    http2: add type checks for Http2ServerResponse.end

    8def934

    http2: add writable* properties to compat api

    0f0720a
  15. MylesBorins
    added a commit that references this issue on Aug 18, 2020

    http: don't throw on `Uint8Array`s for `http.ServerResponse#write`

    8069f8d
  16. addaleax
    added a commit that references this issue on Sep 22, 2020

    http2: do not modify explicity set date headers

    4d0129a
  17. krokowski0x commented on Feb 26, 2021

    @krokowski0x
    krokowski0x
    on Feb 26, 2021
    More actions

    @sogaani any updates on this? I wanted to help out with the http/2 in express proposal but this one seems to be a blocker

  18. markb-trustifi commented on May 16, 2024

    @markb-trustifi
    markb-trustifi
    on May 16, 2024
    More actions

    http2.Http2ServerResponse does not have res.writeProcessing

    Isn't the 102 status code is totally deprecated and will not be added to HTTP/2 standard?
    https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/102#browser_compatibility
    Maybe it should be replaced with multiple res.write()?

  19. QwireyInc
    added a commit that references this issue on Apr 19, 2025

    http2: comment on usage of `Object.create(null)`

    c972ce2
  20. jimmy54
    added a commit that references this issue on Dec 31, 2025

    http: don't throw on `Uint8Array`s for `http.ServerResponse#write`

    ca83634
  21. github-actions commented on Jun 27, 2026

    @github-actions
    github-actionsBot
    on Jun 27, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue has been marked as stale due to 210 days of inactivity.
    It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.

  22. github-actions
    added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Jun 27, 2026
  23. github-actions commented on Jul 28, 2026

    @github-actions
    github-actionsBot
    on Jul 28, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 120 days).
    If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.

  24. github-actions
    closed this as not plannedon Jul 28, 2026
  25. nodejs-github-bot
    added a commit that references this issue on Nov 25, 2026

    http2: add writeProcessing to compat response

    bf201ef
  26. gabylb
    added a commit that references this issue on Nov 27, 2026

    http2: add writeProcessing to compat response

    325ae45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues and PRs related to the http subsystem.http2Issues and PRs related to the http2 subsystem.httpsIssues and PRs related to the https subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.