mirror of
https://github.com/mimblewimble/grin.git
synced 2025-04-30 14:21:14 +03:00
Disable authenthication for OPTIONS requests (#2131)
This commit is contained in:
parent
3bb615a753
commit
ec1713320b
1 changed files with 3 additions and 0 deletions
|
@ -39,6 +39,9 @@ impl Handler for BasicAuthMiddleware {
|
||||||
req: Request<Body>,
|
req: Request<Body>,
|
||||||
mut handlers: Box<dyn Iterator<Item = HandlerObj>>,
|
mut handlers: Box<dyn Iterator<Item = HandlerObj>>,
|
||||||
) -> ResponseFuture {
|
) -> ResponseFuture {
|
||||||
|
if req.method().as_str() == "OPTIONS" {
|
||||||
|
return handlers.next().unwrap().call(req, handlers);
|
||||||
|
}
|
||||||
if req.headers().contains_key(AUTHORIZATION)
|
if req.headers().contains_key(AUTHORIZATION)
|
||||||
&& verify_slices_are_equal(
|
&& verify_slices_are_equal(
|
||||||
req.headers()[AUTHORIZATION].as_bytes(),
|
req.headers()[AUTHORIZATION].as_bytes(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue