Return 4xx (client error) when the client is missing required data in the request, in this case it is the Authorization header. Also going out on a limb saying its a bad request (4xx series) if the server is unable to parse whatever data is that header. Previously, the .unwrap() on the Option would panic the actix-web server. This returns the 4xx response instead of crashing/panic.
I ran cargo fmt and got a bunch of changes, so left those out of the PR.
Return 4xx (client error) when the client is missing required data in the request, in this case it is the
Authorization
header. Also going out on a limb saying its a bad request (4xx series) if the server is unable to parse whatever data is that header. Previously, the.unwrap()
on the Option would panic the actix-web server. This returns the 4xx response instead of crashing/panic.I ran
cargo fmt
and got a bunch of changes, so left those out of the PR.