-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #156: support for multiple HTTP response headers with the same name
- Loading branch information
Showing
6 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
A simple GET request receives a hello world response | ||
*/ | ||
|
||
var net = require('net') | ||
, assert = require('assert'); | ||
|
||
var timeout = setTimeout(function () { | ||
console.error('Timeout occurred'); | ||
assert.ok(false, 'request timed out'); | ||
}, 10000); | ||
|
||
var host = process.env.IISNODETEST_HOST || 'localhost'; | ||
var port = process.env.IISNODETEST_PORT || 31415; | ||
|
||
var client = net.connect(port, host, function () { | ||
client.setEncoding('utf8'); | ||
client.write('GET /122_multipleResponseHeaders/hello.js HTTP/1.1\r\nHost: ' + host + ':' + port + '\r\n\r\n'); | ||
}); | ||
|
||
client.on('data', function (data) { | ||
clearTimeout(timeout); | ||
assert.ok(data.indexOf('Foo: Val1') > 0, 'First instance of Foo header exists in the response'); | ||
assert.ok(data.indexOf('Foo: Val2') > 0, 'Second instance of Foo header exists in the response'); | ||
client.end(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var http = require('http'); | ||
|
||
http.createServer(function (req, res) { | ||
res.writeHead(200, [['Foo','Val1'], ['Foo','Val2']]); | ||
res.end('Hello, world!'); | ||
}).listen(process.env.PORT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<configuration> | ||
<system.webServer> | ||
<handlers> | ||
<add name="iisnode" path="hello.js" verb="*" modules="iisnode" /> | ||
</handlers> | ||
</system.webServer> | ||
</configuration> |