mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
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:
parent
ad0fa77456
commit
4c8db6af87
10 changed files with 103 additions and 86 deletions
|
@ -9,6 +9,7 @@ use crate::filemanager_thread::{FileManager, FILE_CHUNK_SIZE};
|
|||
use crate::http_loader::{determine_requests_referrer, http_fetch, HttpState};
|
||||
use crate::http_loader::{set_default_accept, set_default_accept_language};
|
||||
use crate::subresource_integrity::is_response_integrity_valid;
|
||||
use base64::Engine;
|
||||
use content_security_policy as csp;
|
||||
use crossbeam_channel::Sender;
|
||||
use devtools_traits::DevtoolsControlMsg;
|
||||
|
@ -659,7 +660,8 @@ async fn scheme_fetch(
|
|||
if let Some((secret, bytes)) = data {
|
||||
let secret = str::from_utf8(secret).ok().and_then(|s| s.parse().ok());
|
||||
if secret == Some(*net_traits::PRIVILEGED_SECRET) {
|
||||
if let Ok(bytes) = base64::decode(&bytes[1..]) {
|
||||
if let Ok(bytes) = base64::engine::general_purpose::STANDARD.decode(&bytes[1..])
|
||||
{
|
||||
context.state.extra_certs.add(bytes);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ use crate::hosts::replace_host;
|
|||
use crate::http_loader::HttpState;
|
||||
use async_tungstenite::tokio::{client_async_tls_with_connector_and_config, ConnectStream};
|
||||
use async_tungstenite::WebSocketStream;
|
||||
use base64::Engine;
|
||||
use embedder_traits::resources::{self, Resource};
|
||||
use futures::future::TryFutureExt;
|
||||
use futures::sink::SinkExt;
|
||||
|
@ -93,7 +94,7 @@ fn create_request(
|
|||
}
|
||||
|
||||
if resource_url.password().is_some() || resource_url.username() != "" {
|
||||
let basic = base64::encode(&format!(
|
||||
let basic = base64::engine::general_purpose::STANDARD.encode(&format!(
|
||||
"{}:{}",
|
||||
resource_url.username(),
|
||||
resource_url.password().unwrap_or("")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue