mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 07:03:38 +00:00
Use koa-sslify instead of koa-ssl
This commit is contained in:
parent
34210fb685
commit
e8939eb3db
@ -20,8 +20,14 @@ module.exports = strapi => {
|
||||
|
||||
defaults: {
|
||||
ssl: {
|
||||
disabled: true,
|
||||
trustProxy: false
|
||||
trustProtoHeader: false,
|
||||
trustAzureHeader: false,
|
||||
port: 443,
|
||||
ignoreUrl: false,
|
||||
temporary: false,
|
||||
skipDefaultPort: true,
|
||||
redirectMethods: ['GET', 'HEAD'],
|
||||
internalRedirectMethods: []
|
||||
}
|
||||
},
|
||||
|
||||
@ -31,10 +37,7 @@ module.exports = strapi => {
|
||||
|
||||
initialize: cb => {
|
||||
if (_.isPlainObject(strapi.config.ssl) && !_.isEmpty(strapi.config.ssl)) {
|
||||
strapi.app.use(strapi.middlewares.ssl({
|
||||
disabled: strapi.config.ssl.disabled,
|
||||
trustProxy: strapi.config.ssl.trustProxy
|
||||
}));
|
||||
strapi.app.use(strapi.middlewares.sslify(strapi.config.ssl));
|
||||
}
|
||||
|
||||
cb();
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
"koa-response-time": "~1.0.2",
|
||||
"koa-send": "~3.2.0",
|
||||
"koa-session": "~3.3.1",
|
||||
"koa-ssl": "~2.0.0",
|
||||
"koa-sslify": "^1.1.0",
|
||||
"koa-static": "~2.0.0",
|
||||
"koa-views": "^4.1.0",
|
||||
"lodash": "~4.15.0",
|
||||
|
||||
@ -63,7 +63,7 @@ describe('middlewares', function () {
|
||||
assert(typeof strapi.middlewares.responseTime === 'function');
|
||||
});
|
||||
|
||||
it('`strapi.middlewares.router` should be a function', function () {
|
||||
it('`strapi.middlewares.joiRouter` should be a function', function () {
|
||||
assert(typeof strapi.middlewares.joiRouter === 'function');
|
||||
});
|
||||
|
||||
@ -75,6 +75,10 @@ describe('middlewares', function () {
|
||||
assert(typeof strapi.middlewares.session === 'function');
|
||||
});
|
||||
|
||||
it('`strapi.middlewares.sslify` should be a function', function () {
|
||||
assert(typeof strapi.middlewares.sslify === 'function');
|
||||
});
|
||||
|
||||
it('`strapi.middlewares.static` should be a function', function () {
|
||||
assert(typeof strapi.middlewares.static === 'function');
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user