fix(http): include browser headers if not set by user (#1354)

* fix(http): include browser automatic headers if not set by user

close #1349

* fmt

* Update browser-headers.md

* lint

* generate api
This commit is contained in:
Amr Bashir
2024-05-21 13:43:26 +03:00
committed by GitHub
parent 200f61c99d
commit 9d7ae45b0e
4 changed files with 40 additions and 20 deletions
+5 -5
View File
@@ -45,7 +45,7 @@ pub struct FetchResponse {
rid: ResourceId,
}
#[derive(Deserialize)]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ClientConfig {
method: String,
@@ -57,7 +57,7 @@ pub struct ClientConfig {
proxy: Option<Proxy>,
}
#[derive(Deserialize)]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Proxy {
all: Option<UrlOrConfig>,
@@ -65,7 +65,7 @@ pub struct Proxy {
https: Option<UrlOrConfig>,
}
#[derive(Deserialize)]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
#[serde(untagged)]
pub enum UrlOrConfig {
@@ -73,7 +73,7 @@ pub enum UrlOrConfig {
Config(ProxyConfig),
}
#[derive(Deserialize)]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ProxyConfig {
url: String,
@@ -81,7 +81,7 @@ pub struct ProxyConfig {
no_proxy: Option<String>,
}
#[derive(Deserialize)]
#[derive(Debug, Deserialize)]
pub struct BasicAuth {
username: String,
password: String,