mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
AK+Everywhere: Make Base64 decoding fallible
This commit is contained in:
parent
3bf1f7ae87
commit
cb868cfa41
11 changed files with 73 additions and 32 deletions
|
@ -197,7 +197,10 @@ Optional<HttpRequest::BasicAuthenticationCredentials> HttpRequest::parse_http_ba
|
|||
auto token = value.substring_view(6);
|
||||
if (token.is_empty())
|
||||
return {};
|
||||
auto decoded_token = String::copy(decode_base64(token));
|
||||
auto decoded_token_bb = decode_base64(token);
|
||||
if (!decoded_token_bb.has_value())
|
||||
return {};
|
||||
auto decoded_token = String::copy(decoded_token_bb.value());
|
||||
auto colon_index = decoded_token.find(':');
|
||||
if (!colon_index.has_value())
|
||||
return {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue