Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: http2 connectionListener reject client #16080

Closed
wants to merge 1 commit into from

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Oct 8, 2017

This code change modifies connectionListener tests to cover a test case where this.emit('unknownProtocol', socket) returns false

} else {
// Reject non-HTTP/2 client
return socket.destroy();
}

Refs: #14985

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test, http2

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Oct 8, 2017
@trivikr trivikr force-pushed the test-http2-https-fallback branch from 6e56361 to 54b77aa Compare October 8, 2017 03:09
@mscdex mscdex added the http2 Issues or PRs related to the http2 subsystem. label Oct 8, 2017

server.listen(0);

// Test for checking undefined timeout (code: https://git.io/vdzE9)
server.setTimeout(undefined);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels out of place in this test. I would suggest removing it. If it needs to be tested, there must be a more appropriate existing test to insert it in (one that already deals with timeouts). (The link to git.io is also unnecessary.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the test or removing the check for this.timeout in connectionListener?
I think latter should be done as timeout is always expected to be a number (either default one or the one explicitly set).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the test for setTimeout(undefined). It doesn't relate to http2 https fallback and is likely to just confuse people in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the test for setTimeout(undefined) and updated the commit

This code change modifies connectionListener tests to cover test case
where this.emit('unknownProtocol', socket) returns false

Refs: nodejs#14985
@trivikr trivikr force-pushed the test-http2-https-fallback branch from 54b77aa to b56b64a Compare October 10, 2017 00:06
Copy link
Member

@apapirovski apapirovski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thank you!

@trivikr
Copy link
Member Author

trivikr commented Oct 13, 2017

Can someone create CI link for this request?

@joyeecheung
Copy link
Member

jasnell pushed a commit that referenced this pull request Oct 15, 2017
This code change modifies connectionListener tests to cover test case
where this.emit('unknownProtocol', socket) returns false

PR-URL: #16080
Ref: #14985
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@jasnell
Copy link
Member

jasnell commented Oct 15, 2017

Landed in 3cc725d

@jasnell jasnell closed this Oct 15, 2017
@trivikr trivikr deleted the test-http2-https-fallback branch October 15, 2017 22:34
targos pushed a commit that referenced this pull request Oct 18, 2017
This code change modifies connectionListener tests to cover test case
where this.emit('unknownProtocol', socket) returns false

PR-URL: #16080
Ref: #14985
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Oct 18, 2017
This code change modifies connectionListener tests to cover test case
where this.emit('unknownProtocol', socket) returns false

PR-URL: nodejs/node#16080
Ref: nodejs/node#14985
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http2 Issues or PRs related to the http2 subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants