Socket
Socket
Sign inDemoInstall

@types/koa-sslify

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/koa-sslify

TypeScript definitions for koa-sslify


Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/koa-sslify

Summary

This package contains type definitions for koa-sslify (https://github.com/turboMaCk/koa-sslify#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-sslify.

index.d.ts

// Type definitions for koa-sslify 4.0
// Project: https://github.com/turboMaCk/koa-sslify#readme
// Definitions by: Matthew Bull <https://github.com/wingsbob>
//                 Mihkel Sokk <https://github.com/msokk>
//                 wujingtao <https://github.com/mx601595686>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

import koa = require('koa');

export interface Options {
    /**
     * Function used to test if request is secure
     */
    resolver?: ((ctx: koa.Context) => boolean) | undefined;
    /**
     * Hostname for redirect (uses request host if not set)
     */
    hostname?: string | undefined;
    /**
     * Port of HTTPS server
     */
    port?: number | undefined;
    /**
     * Avoid :443 port in redirect url
     */
    skipDefaultPort?: boolean | undefined;
    /**
     * Ignore url path (redirect to domain)
     */
    ignoreUrl?: boolean | undefined;
    /**
     * Temporary mode (use 307 Temporary Redirect)
     */
    temporary?: boolean | undefined;
    /**
     * Whitelist methods that should be redirected
     */
    redirectMethods?: string[] | undefined;
    /**
     * Status returned for disallowed methods
     */
    disallowStatus?: number | undefined;
}

/**
 * Default HTTPS resolver
 * This works when using node.js TLS support
 */
export function httpsResolver(ctx: koa.Context): boolean;

/**
 * x-forwarded-proto header resolver
 * common for heroku gcp (ingress) etc
 */
export function xForwardedProtoResolver(ctx: koa.Context): boolean;

/**
 * Azure resolver
 * Azure is using `x-att-ssl` header
 */
export function azureResolver(ctx: koa.Context): boolean;

/**
 * Custom proto header factory
 */
export function customProtoHeaderResolver(header: string): (ctx: koa.Context) => boolean;

/**
 * Resolver for `Forwarded` header
 * see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded
 */
export function forwardedResolver(ctx: koa.Context): boolean;

export default function factory(options?: Options): koa.Middleware;

Additional Details

  • Last updated: Thu, 08 Jul 2021 16:23:25 GMT
  • Dependencies: @types/koa
  • Global values: none

Credits

These definitions were written by Matthew Bull, Mihkel Sokk, and wujingtao.

FAQs

Package last updated on 08 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc