bump base64 from 0.10 to 0.21 (#29804)

* bump base64 from 0.10 to 0.21

* Fix configuration of bitflags

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Tuna 2023-08-03 00:25:37 +03:00 committed by GitHub
parent ad0fa77456
commit 4c8db6af87
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 103 additions and 86 deletions

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use base64;
use base64::Engine;
use generic_array::ArrayLength;
use net_traits::response::{Response, ResponseBody, ResponseType};
use sha2::{Digest, Sha256, Sha384, Sha512};
@ -123,7 +123,7 @@ fn apply_algorithm_to_response<S: ArrayLength<u8>, D: Digest<OutputSize = S>>(
if let ResponseBody::Done(ref vec) = *body {
hasher.update(vec);
let response_digest = hasher.finalize(); //Now hash
base64::encode(&response_digest)
base64::engine::general_purpose::STANDARD.encode(&response_digest)
} else {
unreachable!("Tried to calculate digest of incomplete response body")
}