Skip to content

Commit

Permalink
Merge pull request #2 from hatchan/master
Browse files Browse the repository at this point in the history
Use req.secure (if set) - Thanks @hatchan
  • Loading branch information
Adam Baldwin committed Sep 26, 2012
2 parents af1137c + 4495de2 commit 27fc078
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 27fc078

Please sign in to comment.