minor: management auth

This commit is contained in:
Mike Dilger 2024-11-17 13:50:11 +13:00
parent 70a4f91877
commit aa9063e60e
No known key found for this signature in database
GPG Key ID: 47581A78D4329BA4

View File

@ -1,6 +1,7 @@
use crate::error::{ChorusError, Error};
use crate::globals::GLOBALS;
use base64::prelude::*;
use http::header::AUTHORIZATION;
use http_body_util::BodyExt;
use hyper::body::Incoming;
use hyper::Request;
@ -19,7 +20,7 @@ pub async fn check_auth(request: Request<Incoming>) -> Result<Value, Error> {
}
// Must have AUTHORIZATION header
let authz = match request.headers().get("Authorization") {
let authz = match request.headers().get(AUTHORIZATION) {
Some(h) => h,
None => return s_err("Authorization header not of type nostr"),
};