You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using "headers" together with warp to decode basic auth headers. With the current behaviour, my web server would panic if the header value does not start with "Basic ".
It would be great in my opinion if Credentials::decode() could return a Result instead of an Option. In the above use case, Basic::decode() would return an Err instead of panicking.
Current behavior:
let header_value = http::header::HeaderValue::from_static("Bazic xxx");
let basic = Basic::decode(&header_value); // panic
Feature request (with error handling):
let header_value = http::header::HeaderValue::from_static("Bazic xxx");
let basic = Basic::decode(&header_value).map_err(...)?; // proper error handling
The text was updated successfully, but these errors were encountered:
I'm using "headers" together with warp to decode basic auth headers. With the current behaviour, my web server would panic if the header value does not start with "Basic ".
It would be great in my opinion if Credentials::decode() could return a Result instead of an Option. In the above use case, Basic::decode() would return an Err instead of panicking.
Current behavior:
Feature request (with error handling):
The text was updated successfully, but these errors were encountered: