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>,
}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 serve --allow-origin 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_origin_allowed 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.
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>,
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 Eq 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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more