mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 10:27:42 +02:00
fix: broken stream when authentication failed (#260)
* fix: broken http stream when authentication failed Signed-off-by: Roland Ma <rolandma@outlook.com> * remove unchanged Signed-off-by: Roland Ma <rolandma@outlook.com> * Update CHANGES.md * Update CHANGES.md * Update CHANGES.md Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
@ -3,7 +3,10 @@ use actix_web::{middleware, web, App, Error, HttpServer};
|
||||
use actix_web_httpauth::extractors::basic::BasicAuth;
|
||||
use actix_web_httpauth::middleware::HttpAuthentication;
|
||||
|
||||
async fn validator(req: ServiceRequest, _credentials: BasicAuth) -> Result<ServiceRequest, Error> {
|
||||
async fn validator(
|
||||
req: ServiceRequest,
|
||||
_credentials: BasicAuth,
|
||||
) -> Result<ServiceRequest, (Error, ServiceRequest)> {
|
||||
Ok(req)
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ use actix_web_httpauth::{extractors::bearer::BearerAuth, middleware::HttpAuthent
|
||||
async fn ok_validator(
|
||||
req: ServiceRequest,
|
||||
credentials: BearerAuth,
|
||||
) -> Result<ServiceRequest, Error> {
|
||||
) -> Result<ServiceRequest, (Error, ServiceRequest)> {
|
||||
eprintln!("{:?}", credentials);
|
||||
Ok(req)
|
||||
}
|
||||
|
Reference in New Issue
Block a user