nl_tokens: middleware itself
pl_tokens: function redirect ( options , ctx ) { // Check if method should be disallowed if ( options . redirectMethods . indexOf ( ctx . method ) === - 1 ) { ctx . <mask> . status = options . disallowStatus ; if ( options . disallowStatus === 405 ) { ctx . response . set ( 'Allow' , options . redirectMethods . join ( ', ' ) ) ; } ctx . response . body = '' ; return ; } // build redirect url const httpsHost = options . hostname || url . parse ( 'http://' + ctx . request . header . host ) . hostname ; let redirectTo = ` ${ httpsHost } ${ portToUrlString ( options ) } ` ; if ( ! options . ignoreUrl ) { redirectTo += ctx . request . url ; } // redirect to secure ctx . response . status = options . temporary ? 307 : 301 ; ctx . response . redirect ( redirectTo ) ; }