Skip to content
Snippets Groups Projects
Commit ee9dc0fa authored by Sigmund, Dominik's avatar Sigmund, Dominik
Browse files

Merge branch 'develop' into 'main'

better structure

See merge request !3
parents 3ee543e5 d477b075
No related branches found
No related tags found
1 merge request!3better structure
Pipeline #8281 failed
......@@ -4,4 +4,5 @@ export = Security;
declare class Security {
constructor();
setHeaders(req: express.Request, res: express.Response, next: express.NextFunctiont): void;
}
module.exports = function(options) {
return function(req, res, next) {
if(!options) options = {}
module.exports = function(options = {}) {
let security = {}
security.options = options
security.setHeaders = function(req, res, next) {
if(!this.options) options = {}
else options = this.options
if (typeof options.CacheControl === 'undefined') {
options.CacheControl = 'no-cache, no-store, must-revalidate'
......@@ -137,4 +141,6 @@ module.exports = function(options) {
next()
}
return security;
}
\ No newline at end of file
{
"name": "@libs/security",
"version": "2.2.3",
"version": "2.3.0",
"description": "Sets Headers to a very save style in express-apps. may be overriden by config",
"main": "index.js",
"scripts": {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment