class Slsy

This class represents a new Slsy singleton for you to use in your Oak application as a middleware. Slsy is designed to handle HTTP security headers inside your Oak application.

Examples

Create an instance of the Slsy class with default options

const slsy: Slsy = new Slsy();

Use the slsy middleware in an Oak application server

 import { Application, Context, Next } from "@oak/oak";
 import { Slsy } from "@ventgrey/slsy";
  const app: Application = new Application();
   const slsy: Slsy = new Slsy({
     hidePoweredBy: {
         setTo: "Deno-saurius",
       },
       ienoopen: true,
   });
   app.use((ctx: Context, next: Next) => {
       ctx.response = slsy.slsy(ctx.request, ctx.response);
       next();
   });
   app.use((ctx: Context) => {
       ctx.response.body = { message: "Hello JSR fellas!" };
   });

Constructors

new
Slsy(options?: SLSyOptions)

Initializes a new instance of the class with the specified options.

Properties

The options object to pass to the Slsy class.

Methods

slsy(
request: Request,
response: Response,
): Response

Calls various middleware functions based on the provided options and returns the response.