DarrenBaldwin07 / clerk-rs

An unofficial Rust SDK for Clerk.dev
https://crates.io/crates/clerk-rs
MIT License
58 stars 23 forks source link

handle missing request header #5

Closed ChuckHend closed 1 year ago

ChuckHend commented 1 year ago

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.