import express from 'express' ; import { BaseResult } from './BaseResult' ; import { OutgoingHttpHeaders } from 'http' ; export class RedirectResult extends BaseResult { constructor ( public readonly location , public readonly status ? , public readonly headers ? ) { super ( ) ; } async execute ( req , res , next ) { if ( this . headers != null ) { res . set ( this . headers ) ; } if ( this . status != null ) return res . redirect ( this . status , this . location ) ; return res . redirect ( this . location ) ; } }