-
Notifications
You must be signed in to change notification settings - Fork 57
Conversation
wooow, thanks! Can you add a quick unit test for this? You can see an example in: https://github.com/nodejs/http2/blob/master/test/parallel/test-http2-create-client-session.js. I'm not 100% sure what was the problem in the first place, so the test would help as well. |
@mcollina The problem was that Actually I don't quite like the Will also work on a test case, sure. 😄 |
Why not pass the stream[kHeaders] = headers; |
@jasnell Yep, doing that now. Got confused because the property getters use get/has. Not sure why...? |
bf32825
to
6c3b5c9
Compare
PS: I see some unfinished provisions for implementing trailers on |
@mcollina @jasnell I did some more work over the weekend to fix the compatibility layer. Please take a look and let me know what you think. My aim is to make it work similar to Node.js' http APIs. Also added more tests, as requested. Probably covers some of #42.
|
I'll take a more detailed look through in the morning. |
@mcollina Thank you for the feedback! 🙇 Have now separated the tests into separate files. Also linted the code. Notes to self: Run Eslint as per the Makefile:
Quickly run the relevant test cases in bash:
|
WIP:
|
can you please open a separate issue about cookies? |
In 3739695 I've implemented a minimalist API for push requests and push responses. server.on('request', (request, response) => {
const headers = {
':path': '/foobar.txt',
'content-type': 'text/plain; charset=utf8'
}
const pushRequest = response.createPushRequest(headers)
// createPushRequest returns an Http2PushRequest
// Its argument is a plain Object with the PUSH_PROMISE headers (key/value).
// Its only method is .push() which sends the PUSH_PROMISE frame,
// and offers a callback to deal with the push response.
pushRequest.push((error, pushResponse) => {
// pushResponse is just an Http2ServerResponse,
// so it can do all the usual tricks...
pushResponse.writeHead(200, headers)
pushResponse.end('Hello, World!')
})
}) @jasnell Would you be okay with this design replacing the one from the implementation notes example? It omits the
|
6f3335f
to
3739695
Compare
@mcollina @jasnell Please review the C++ changes in 7f8a5eb#diff-20934af26ea78010b56b52f2fc636a18 This commit adds support for promised stream ID when receiving headers. The test case in However I'm seeing this error on exit:
Any ideas? It's been 20 years since I touched C++. This has been another adventurous weekend. 😅 Update: Added a workaround inn 44cc0b8. By delaying the server's |
bd09d1c
to
7f8a5eb
Compare
This PR will need to be reworked. I've updated the master against the latest core and squashed the numerous http2 related commits to clean things up and get us ready for the next phase of cleanup and adding tests, etc. |
@jasnell Great! I'll get to work on it. 🕺 |
44cc0b8
to
430f9a6
Compare
@jasnell I have reworked the code according to the new client API. Also rebased/squashed and then cherry-picked the patch as one commit onto the updated master branch. Hope this is acceptable. 😫 Apologies for losing the individual commits — I struggle with advanced git-fu. |
430f9a6
to
cbc31b7
Compare
f46fbd4
to
e48514b
Compare
e48514b
to
8f07be5
Compare
Thanks for the thorough reviews, @jasnell. |
c6a2fe2
to
b251eb6
Compare
@sebdeckers sorry this conflicted with @yosuke-furukawa change. Would any of you fix things? |
b251eb6
to
6765d00
Compare
@yosuke-furukawa Does the change in 6765d00 work for you? (See also The The |
PR-Url: #47 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed as cee5479 |
@sebdeckers ... thank you for bearing with us on this. I know it took a while to get landed. |
PR-Url: #47 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-Url: #47 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-Url: nodejs#47 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-Url: nodejs#47 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-Url: nodejs#47 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Accessing the request's headers was returning
undefined
. This is a quick fix that converts the headers object to a Map. Probably not the best for performance, but I wasn't sure if you'd rather rewrite all the property getters that expect.has
and.get
methods.