Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Yu Wei committed Oct 15, 2022
1 parent 7ce6a9c commit 6a9a75e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/webview/webkitgtk/web_context.rs
Expand Up @@ -6,7 +6,10 @@

use crate::{webview::web_context::WebContextData, Error};
use glib::FileError;
use http::{header::{CONTENT_TYPE, HeaderName}, Request, Response, HeaderValue};
use http::{
header::{HeaderName, CONTENT_TYPE},
HeaderValue, Request, Response,
};
use std::{
collections::{HashSet, VecDeque},
rc::Rc,
Expand All @@ -16,7 +19,6 @@ use std::{
},
};
use url::Url;
//use webkit2gtk_sys::webkit_uri_request_get_http_headers;
use webkit2gtk::{
traits::*, ApplicationInfo, CookiePersistentStorage, LoadEvent, UserContentManager, WebContext,
WebContextBuilder, WebView, WebsiteDataManagerBuilder,
Expand Down Expand Up @@ -225,15 +227,15 @@ where
// FIXME: Read the body (forms post)
let mut http_request = Request::builder().uri(uri).method("GET");
if let Some(mut http_headers) = request.http_headers() {
if let Some(map) = http_request.headers_mut() {
http_headers.foreach(move |k, v| {
if let Ok(name) = HeaderName::from_bytes(k.as_bytes()) {
if let Ok(value) = HeaderValue::from_bytes(v.as_bytes()) {
map.insert(name, value);
}
}
});
}
if let Some(map) = http_request.headers_mut() {
http_headers.foreach(move |k, v| {
if let Ok(name) = HeaderName::from_bytes(k.as_bytes()) {
if let Ok(value) = HeaderValue::from_bytes(v.as_bytes()) {
map.insert(name, value);
}
}
});
}
}
let http_request = match http_request.body(Vec::new()) {
Ok(req) => req,
Expand Down

0 comments on commit 6a9a75e

Please sign in to comment.