Skip to content

test: invalid chars in http client path - #11964

Closed
lucamaraschi wants to merge 1 commit into
nodejs:masterfrom
lucamaraschi:test-http-invalid-path-chars
Closed

test: invalid chars in http client path#11964
lucamaraschi wants to merge 1 commit into
nodejs:masterfrom
lucamaraschi:test-http-invalid-path-chars

Conversation

@lucamaraschi

Copy link
Copy Markdown
Contributor

This test adds coverage for all the characters which are considered
invalid in a http path.

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

test http-client

@nodejs-github-botnodejs-github-bot added the test Issues and PRs related to the tests. label Mar 21, 2017
@lucamaraschi
lucamaraschiforce-pushed the test-http-invalid-path-chars branch from 2424b76 to ae7cdbeCompareMarch 21, 2017 15:31

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add common.mustCall() around the callback.

@Fishrock123

Copy link
Copy Markdown
Contributor

@mscdexmscdex added the http Issues or PRs related to the http subsystem. label Mar 21, 2017
@mscdex

Copy link
Copy Markdown
Contributor

I think it would be better to try a path string for each control character instead of all of them together.

Also, I don't think we need to spin up a server just to check for the TypeError.

@jasnell

Copy link
Copy Markdown
Member

Definitely agree with @mscdex. Testing each individually would be more robust.

This test adds coverage for all the characters which are considered
invalid in a http path.
@lucamaraschi
lucamaraschiforce-pushed the test-http-invalid-path-chars branch from 729b3d9 to f9c57feCompareMarch 23, 2017 13:13
@lpinca

Copy link
Copy Markdown
Member

@jasnell

Copy link
Copy Markdown
Member

extremely minor nit: for the "experimentally" determined number, it may be useful to include a comment that describes the process you followed to find that number :-)

@lpinca

Copy link
Copy Markdown
Member

I guess the comment should be added here

if(path.length<=39){// Determined experimentally in V8 5.4
:)

jasnell pushed a commit that referenced this pull request Mar 24, 2017
This test adds coverage for all the characters which are considered
invalid in a http path.
PR-URL: #11964
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

Copy link
Copy Markdown
Member

Landed in 30f1e8e

@jasnelljasnell closed this Mar 24, 2017
MylesBorins pushed a commit that referenced this pull request Mar 28, 2017
This test adds coverage for all the characters which are considered
invalid in a http path.
PR-URL: #11964
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Mar 28, 2017
@italoacasasitaloacasas mentioned this pull request Apr 10, 2017
2 tasks
MylesBorins pushed a commit that referenced this pull request Apr 18, 2017
This test adds coverage for all the characters which are considered
invalid in a http path.
PR-URL: #11964
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Apr 19, 2017
This test adds coverage for all the characters which are considered
invalid in a http path.
PR-URL: #11964
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Apr 19, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
This test adds coverage for all the characters which are considered
invalid in a http path.
PR-URL: nodejs/node#11964
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

httpIssues or PRs related to the http subsystem.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@lucamaraschi@Fishrock123@mscdex@jasnell@lpinca@cjihrig@MylesBorins@nodejs-github-bot