forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit does various changes to cleanup and prep the 8ff6b81 for merging, which include updating the commit to follow new codebase guidelines. The following are the changes: doc/api/http.markdown: - document options lib/http.js: - no changes lib/_http_server.js - changes regarding isObject (nodejs#647) and hasOwnProperty (nodejs#635) - take tls option rather than guessing based on options test/simple/test-https-from-http.js: - moved to parallel directory, crypto test, removed copyright banner test/parallel/test-http-server.js: - adjust for tls option
- Loading branch information
1 parent
8ff6b81
commit b3b6b24
Showing
5 changed files
with
63 additions
and
83 deletions.
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,50 @@ | ||
var common = require('../common'); | ||
var assert = require('assert'); | ||
var fs = require('fs'); | ||
var http = require('http'); | ||
|
||
if (!common.hasCrypto) { | ||
console.log('1..0 # Skipped: missing crypto'); | ||
process.exit(); | ||
} | ||
|
||
var https = require('https'); | ||
|
||
var options = { | ||
tls: true, | ||
key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), | ||
cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') | ||
}; | ||
|
||
var reqCount = 0; | ||
var body = 'test'; | ||
|
||
var server = http.createServer(options, function(req, res) { | ||
reqCount++; | ||
res.writeHead(200, {'content-type': 'text/plain'}); | ||
res.end(body); | ||
}); | ||
|
||
assert(server instanceof https.Server); | ||
|
||
server.listen(common.PORT, function() { | ||
https.get({ | ||
port: common.PORT, | ||
rejectUnauthorized: false | ||
}, function(res) { | ||
var data = ''; | ||
|
||
res.on('data', function(chunk) { | ||
data += chunk.toString(); | ||
}); | ||
|
||
res.on('end', function() { | ||
assert.equal(data, body); | ||
server.close(); | ||
}); | ||
}); | ||
}); | ||
|
||
process.on('exit', function() { | ||
assert.equal(1, reqCount); | ||
}); |
This file was deleted.
Oops, something went wrong.