Merge pull request #10871 from horiuchi/add-secure-auto

Add secure: `auto` option to `express-session`
This commit is contained in:
Horiuchi_H
2016-08-30 11:40:43 +09:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -121,7 +121,7 @@ declare module "express-serve-static-core" {
httpOnly?: boolean;
path?: string;
domain?: string;
secure?: boolean;
secure?: boolean | 'auto';
}
interface Errback { (err: Error): void; }
@@ -199,7 +199,7 @@ declare module "express-serve-static-core" {
/**
* Returns the first accepted charset of the specified character sets,
* based on the requests Accept-Charset HTTP header field.
* based on the request's Accept-Charset HTTP header field.
* If none of the specified charsets is accepted, returns false.
*
* For more information, or if you have issues or concerns, see accepts.
@@ -212,7 +212,7 @@ declare module "express-serve-static-core" {
/**
* Returns the first accepted encoding of the specified encodings,
* based on the requests Accept-Encoding HTTP header field.
* based on the request's Accept-Encoding HTTP header field.
* If none of the specified encodings is accepted, returns false.
*
* For more information, or if you have issues or concerns, see accepts.
@@ -225,7 +225,7 @@ declare module "express-serve-static-core" {
/**
* Returns the first accepted language of the specified languages,
* based on the requests Accept-Language HTTP header field.
* based on the request's Accept-Language HTTP header field.
* If none of the specified languages is accepted, returns false.
*
* For more information, or if you have issues or concerns, see accepts.

View File

@@ -6,7 +6,8 @@ import session = require('express-session');
var app = express();
app.use(session({
secret: 'keyboard cat'
secret: 'keyboard cat',
cookie: { secure: 'auto' }
}));
app.use(session({
secret: 'keyboard cat',