[lusca] Fix tests and linting

This commit is contained in:
Corbin
2017-11-19 20:58:25 -08:00
parent 69a72b19f0
commit 9bb9e1b3d3
3 changed files with 7 additions and 5 deletions
+4 -3
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/krakenjs/lusca#readme
// Definitions by: Corbin Crutchley <https://github.com/crutchcorn>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import express = require('express');
@@ -17,13 +18,13 @@ declare namespace lusca {
xframe?: string | false;
p3p?: string | false;
hsts?: hstsOptions | false;
xssProtection?: boolean;
xssProtection?: xssProtectionOptions | boolean;
nosniff?: boolean;
referrerPolicy?: string | false;
}
interface cspOptions {
policy?: string | object | (object | string)[];
policy?: string | object | Array<object | string>;
reportOnly?: boolean;
reportUri?: string;
styleNonce?: boolean;
@@ -69,7 +70,7 @@ declare namespace lusca {
function xframe(value: string): express.RequestHandler;
function p3p(value: string): express.RequestHandler;
function hsts(options?: hstsOptions): express.RequestHandler;
function xssProtection(options?: xssProtectionOptions): express.RequestHandler;
function xssProtection(options?: xssProtectionOptions | true): express.RequestHandler;
function nosniff(): express.RequestHandler;
function referrerPolicy(value: string): express.RequestHandler;
}
+2 -2
View File
@@ -13,9 +13,9 @@ app.use(lusca({
nosniff: true,
referrerPolicy: 'same-origin'
}));
app.use(lusca.csrf());
app.use(lusca.csp({policy: [{ "img-src": "'self' http:" }, "block-all-mixed-content"]
, reportOnly: false}));
app.use(lusca.csp({policy: [{ "img-src": "'self' http:" }, "block-all-mixed-content"], reportOnly: false}));
app.use(lusca.xframe('SAMEORIGIN'));
app.use(lusca.p3p('ABCDEF'));
app.use(lusca.hsts({ maxAge: 31536000 }));
+1
View File
@@ -7,6 +7,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"