private void endRequest ( HttpServerExchange exchange ) { exchange . setStatusCode ( StatusCodes . UNAUTHORIZED ) ; Server . headers ( ) . entrySet ( ) . stream ( ) . filter ( entry -> StringUtils . isNotBlank ( entry . getValue ( ) ) ) . forEach ( entry -> exchange . getResponseHeaders ( ) . add ( entry . getKey ( ) . toHttpString ( ) , entry . getValue ( ) ) ) ; exchange . endExchange ( ) ; }
Ends the current request by sending a HTTP 401 status code and the default unauthorized template