Merge pull request #61 from RadianSmile/patch-1
redirect all http request actions to https
This commit is contained in:
commit
d5b8f7a5c6
|
@ -131,7 +131,7 @@ var https = require('spdy');
|
||||||
function redirectHttp() {
|
function redirectHttp() {
|
||||||
http.createServer(LEX.createAcmeResponder(lex, function redirectHttps(req, res) {
|
http.createServer(LEX.createAcmeResponder(lex, function redirectHttps(req, res) {
|
||||||
res.setHeader('Location', 'https://' + req.headers.host + req.url);
|
res.setHeader('Location', 'https://' + req.headers.host + req.url);
|
||||||
res.statusCode = 302;
|
res.statusCode = 302; // use 307 if you want to redirect requests with POST, DELETE or PUT action.
|
||||||
res.end('<!-- Hello Developer Person! Please use HTTPS instead -->');
|
res.end('<!-- Hello Developer Person! Please use HTTPS instead -->');
|
||||||
})).listen(80);
|
})).listen(80);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue