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: test requests with Unicode in the URL #13297

Closed
wants to merge 3 commits into from

Conversation

Flimm
Copy link
Contributor

@Flimm Flimm commented May 30, 2017

This test currently fails. It illustrates that Unicode in the URL does
not arrive intact to the server, there is silent data corruption along
the way at some point.

This test is for the issue #13296.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes (this doesn't pass, as the test is only an illustration for a bug)
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

http

This test currently fails. It illustrates that Unicode in the URL does
not arrive intact to the server, there is silent data corruption along
the way at some point.

This test is for the issue nodejs#13296.
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
Copy link
Member

Choose a reason for hiding this comment

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

New files do not need the copyright header at the top

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

'Sanity check that string literal produced the expected string'
);

const server = http.Server(function(req, res) {
Copy link
Member

Choose a reason for hiding this comment

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

http.createServer() here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

const server = http.Server(function(req, res) {
result = req.url;
req.on('data', function() {
}).on('end', function() {
Copy link
Member

Choose a reason for hiding this comment

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

these should be wrapped in common.mustCall()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

path: expected,
method: 'GET'
}, function(res) {
console.log(res.statusCode);
Copy link
Member

Choose a reason for hiding this comment

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

Please omit the extraneous console output

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

}).end();
});

process.on('exit', function() {
Copy link
Member

Choose a reason for hiding this comment

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

If using common.mustCall() and inline asserts, there's no need for an exit handler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

Since this test would be expected to fail with an issue that has not yet been solved, it should be moved into the test/known_issues directory instead of parallel

@Flimm
Copy link
Contributor Author

Flimm commented May 30, 2017

I've moved the test to known_issues as requested and I've made the changes that were asked for. I was copying the style of an existing test-http-... test, but now I noticed this document as I was looking up mustCall: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md Thanks @jasnell .

@jasnell
Copy link
Member

jasnell commented May 30, 2017

Thank you @Flimm ... moving the test to known_issues is particularly useful as those are actually run in CI with the expectation that they will fail. That way, if they end up getting fixed somehow, we'll know right away. As for the style of the other tests, we've been slowly and incrementally updating all of the existing tests.

@mscdex mscdex added the http Issues or PRs related to the http subsystem. label May 30, 2017
@jasnell
Copy link
Member

jasnell commented Jun 1, 2017

jasnell pushed a commit that referenced this pull request Jun 2, 2017
This test currently fails. It illustrates that Unicode in the URL does
not arrive intact to the server, there is silent data corruption along
the way at some point.

This test is for the issue #13296.

PR-URL: #13297
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Jun 2, 2017

Landed in 592d7d2

@jasnell jasnell closed this Jun 2, 2017
jasnell pushed a commit that referenced this pull request Jun 5, 2017
This test currently fails. It illustrates that Unicode in the URL does
not arrive intact to the server, there is silent data corruption along
the way at some point.

This test is for the issue #13296.

PR-URL: #13297
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell jasnell mentioned this pull request Jun 5, 2017
@gibfahn gibfahn mentioned this pull request Jun 15, 2017
3 tasks
MylesBorins pushed a commit that referenced this pull request Jul 17, 2017
This test currently fails. It illustrates that Unicode in the URL does
not arrive intact to the server, there is silent data corruption along
the way at some point.

This test is for the issue #13296.

PR-URL: #13297
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants