pub struct ControlRequest {
pub url: String,
pub method: String,
pub headers: BTreeMap<String, String>,
pub body: Option<String>,
pub stream: bool,
pub target: Option<String>,
pub allow_origin: Option<String>,
pub credentials: Option<String>,
pub encoding: Option<String>,
}Expand description
A request as supplied by a control-plane caller (the POST /__bridge/request
body, or synthesised from the path/method/headers of a transparent-proxy
request).
url is resolved against the page origin by the browser snippet; absolute
URLs are rejected by the server unless an --allow-origin permits them.
Fields§
§url: StringRequest URL. Relative (page-origin) by default.
method: StringHTTP method. Defaults to GET when omitted.
headers: BTreeMap<String, String>Request headers. Forwarded verbatim to the browser fetch().
body: Option<String>Request body, or null for no body.
stream: boolWhen true, the response is streamed back as incremental chunk frames
(response.body.getReader()) rather than buffered into one reply.
target: Option<String>Which connected tab to route this request to: a connection id (the
canonical, always-unambiguous selector) or an Origin string that
uniquely matches one tab. Omitted is allowed only when exactly one tab is
connected. The X-Omni-Bridge-Target header takes precedence over this
field. Server-side routing only — never sent to the browser.
allow_origin: Option<String>Request-scoped outbound-origin override. When present it takes
precedence over the per-origin serve --allow-origin grant for this
request’s crate::browser::auth::validate_outbound_url check only,
letting one request target a cross-origin URL without affecting the
connection-time WS-upgrade gate. Server-side scope check only — never sent
to the browser.
credentials: Option<String>Fetch credentials mode (include | omit | same-origin). Absent means
the browser snippet defaults to include, preserving v1 behavior.
encoding: Option<String>Request-body transfer encoding. Some("base64") means body is a base64
string the browser snippet decodes to a byte array before fetch();
absent (the default) means body is UTF-8 text, preserving v1
wire-compat. Mirrors the response-side encoding on BrowserReply.
Trait Implementations§
Source§impl Clone for ControlRequest
impl Clone for ControlRequest
Source§fn clone(&self) -> ControlRequest
fn clone(&self) -> ControlRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ControlRequest
impl Debug for ControlRequest
Source§impl<'de> Deserialize<'de> for ControlRequest
impl<'de> Deserialize<'de> for ControlRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ControlRequest
Source§impl PartialEq for ControlRequest
impl PartialEq for ControlRequest
Source§fn eq(&self, other: &ControlRequest) -> bool
fn eq(&self, other: &ControlRequest) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ControlRequest
impl Serialize for ControlRequest
impl StructuralPartialEq for ControlRequest
Auto Trait Implementations§
impl Freeze for ControlRequest
impl RefUnwindSafe for ControlRequest
impl Send for ControlRequest
impl Sync for ControlRequest
impl Unpin for ControlRequest
impl UnsafeUnpin for ControlRequest
impl UnwindSafe for ControlRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.