remove extra Uri conversion

This commit is contained in:
yggverse 2025-07-24 09:37:42 +03:00
parent c7a9a62566
commit fc87c4ce00
4 changed files with 13 additions and 13 deletions

View file

@ -152,6 +152,7 @@ fn handle(
) {
const EVENT_COMPLETED: &str = "Completed";
let uri = request.uri().clone();
let url = uri.to_string();
let server_certificate = this
.page
.profile
@ -161,7 +162,7 @@ fn handle(
this.client
.socket
.set_proxy_resolver(this.page.profile.proxy.matches(&uri).as_ref());
.set_proxy_resolver(this.page.profile.proxy.matches(&url).as_ref());
this.client.request_async(
request,
@ -172,7 +173,7 @@ fn handle(
this.page
.profile
.identity
.get(&uri.to_string()).map(|identity|identity.to_tls_certificate().unwrap()),
.get(&url).map(|identity|identity.to_tls_certificate().unwrap()),
server_certificate.map(|c|vec![c]),
{
let page = this.page.clone();
@ -192,7 +193,7 @@ fn handle(
use gtk::prelude::SocketConnectionExt;
let mut i = page.navigation.request.info.borrow_mut();
i
.set_request(Some(uri.to_string()))
.set_request(Some(url))
.set_socket(Some((
connection.socket_connection.local_address().unwrap(),
connection.socket_connection.remote_address().unwrap()

View file

@ -43,7 +43,9 @@ impl Nex {
.set_request(Some(uri.to_string()));
}
let path = uri.path(); // copy once
// copy once
let path = uri.path();
let url = uri.to_string();
if path.is_empty() {
// auto-append trailing slash to the root locations
@ -67,7 +69,7 @@ impl Nex {
}
let socket = SocketClient::new();
socket.set_proxy_resolver(self.page.profile.proxy.matches(&uri).as_ref());
socket.set_proxy_resolver(self.page.profile.proxy.matches(&url).as_ref());
socket.set_protocol(SocketProtocol::Tcp);
socket.set_timeout(30); // @TODO optional
@ -118,7 +120,7 @@ impl Nex {
}
});
socket.connect_to_uri_async(&uri.to_string(), 1900, Some(&cancellable.clone()), {
socket.connect_to_uri_async(&url, 1900, Some(&cancellable.clone()), {
let p = self.page.clone();
move |result| match result {
Ok(c) => {

View file

@ -138,7 +138,7 @@ impl Request {
// Indicate proxy connections
{
const C: &str = "accent";
if uri(e).is_some_and(|u| p.proxy.matches(&u).is_some()) {
if p.proxy.matches(&e.text()).is_some() {
e.set_css_classes(&[C])
} else {
e.remove_css_class(C)