New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@response/redirect

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@response/redirect

A class representing a redirect response.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

Redirect Response

A class representing a redirect response.

Installation

npm install @response/redirect

Usage

const redirect = require('@response/redirect')
const http = require('http')

http.createServer((req, res) => {
  // Status 302
  redirect('/thing').write(res)

  // Status 301
  redirect(301, '/thing').write(res)

  // Status 301 & custom headers
  redirect(301, '/thing', { 'X-Powered-By': 'Foobar' }).write(res)
})

Mutable Properties

  • statusCode: number - The status code
  • headers: object - The custom headers
  • url: string - The target of the redirect

FAQs

Package last updated on 11 Oct 2023

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