Skip to content

Commit

Permalink
Use req.secure if it is set
Browse files Browse the repository at this point in the history
  • Loading branch information
hatchan committed Sep 26, 2012
1 parent af1137c commit 4495de2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/middleware/hsts.js
Expand Up @@ -12,7 +12,7 @@ module.exports = function (maxAge, includeSubdomains) {
if (includeSubdomains) header += '; includeSubdomains';

return function (req, res, next) {
if (req.connection.encrypted) {
if (typeof req.secure !== "undefined" ? req.secure : req.connection.encrypted) {
res.header('Strict-Transport-Security', header);
}
next();
Expand Down

0 comments on commit 4495de2

Please sign in to comment.