mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
[lusca] Fix tests and linting
This commit is contained in:
Vendored
+4
-3
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 }));
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
Reference in New Issue
Block a user