aboutsummaryrefslogtreecommitdiffstats
path: root/components/net/http_loader.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-04-02 00:59:50 +0200
committerGitHub <noreply@github.com>2025-04-01 22:59:50 +0000
commit4402b7cf8f56aa6e62a13dd1997b570e7331b72e (patch)
treefa68aa51981c263fd3ee66e816fd600322b35b19 /components/net/http_loader.rs
parent0d38d6239a4356928c2a7ec0a3cd53ecc32096b0 (diff)
downloadservo-4402b7cf8f56aa6e62a13dd1997b570e7331b72e.tar.gz
servo-4402b7cf8f56aa6e62a13dd1997b570e7331b72e.zip
libservo: Remove a couple `EmbedderMethods` (#36276)
- Remove `EmbedderMethods::get_user_agent_string`. This is now part of the `Preferences` data structure, which should allow it to be per-`WebView` in the future. - Remove `EmbedderMethods::get_version_string`. This was used to include some data along with WebRender captures about the Servo version. This isn't really necessary and it was done to replace code in the past that output the WebRender version, so also isn't what the original code did. I think we can just remove this entirely. The idea with these changes is that `EmbedderMethods` can be removed in a followup and the rest of the methods can be added to `ServoDelegate`. These two methods are ones that cannot be added to a delegate as they are used during `Servo` initialization. Testing: There is currently no testing for libservo. These changes are meant as preparation for adding a suite of `WebView` unit tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/net/http_loader.rs')
-rw-r--r--components/net/http_loader.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/net/http_loader.rs b/components/net/http_loader.rs
index 8549b11a101..b6f107878a4 100644
--- a/components/net/http_loader.rs
+++ b/components/net/http_loader.rs
@@ -1255,10 +1255,9 @@ async fn http_network_or_cache_fetch(
// Step 8.15: If httpRequest’s header list does not contain `User-Agent`, then user agents
// should append (`User-Agent`, default `User-Agent` value) to httpRequest’s header list.
if !http_request.headers.contains_key(header::USER_AGENT) {
- let user_agent = context.user_agent.clone().into_owned();
http_request
.headers
- .typed_insert::<UserAgent>(user_agent.parse().unwrap());
+ .typed_insert::<UserAgent>(context.user_agent.parse().unwrap());
}
// Steps 8.16 to 8.18