2016-02-15 18:40:58 +01:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
2016-11-05 13:59:49 +01:00
|
|
|
|
|
|
|
// This test ensures that the http-parser can handle UTF-8 characters
|
|
|
|
// in the http header.
|
|
|
|
|
2016-02-15 18:40:58 +01:00
|
|
|
const http = require('http');
|
|
|
|
const assert = require('assert');
|
|
|
|
|
|
|
|
const server = http.createServer(common.mustCall((req, res) => {
|
|
|
|
res.end('ok');
|
|
|
|
}));
|
2016-05-29 09:06:56 +02:00
|
|
|
server.listen(0, () => {
|
2016-02-15 18:40:58 +01:00
|
|
|
http.get({
|
2016-05-29 09:06:56 +02:00
|
|
|
port: server.address().port,
|
2016-02-15 18:40:58 +01:00
|
|
|
headers: {'Test': 'Düsseldorf'}
|
|
|
|
}, common.mustCall((res) => {
|
2016-11-05 13:59:49 +01:00
|
|
|
assert.strictEqual(res.statusCode, 200);
|
2016-02-15 18:40:58 +01:00
|
|
|
server.close();
|
|
|
|
}));
|
|
|
|
});
|