pub enum HttpPathModifier {
ReplaceFullPath {
replace_full_path: String,
},
ReplacePrefixMatch {
replace_prefix_match: String,
},
}
Expand description
HTTPPathModifier defines configuration for path modifiers.
Variants§
ReplaceFullPath
ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.
ReplacePrefixMatch
ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to “/foo/bar” with a prefix match of “/foo” and a ReplacePrefixMatch of “/xyz” would be modified to “/xyz/bar”.
Note that this matches the behavior of the PathPrefix match type. This
matches full path elements. A path element refers to the list of labels
in the path split by the /
separator. When specified, a trailing /
is
ignored. For example, the paths /abc
, /abc/
, and /abc/def
would all
match the prefix /abc
, but the path /abcd
would not.
ReplacePrefixMatch is only compatible with a PathPrefix
HTTPRouteMatch.
Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in
the implementation setting the Accepted Condition for the Route to status: False
.
Request Path | Prefix Match | Replace Prefix | Modified Path |
---|---|---|---|
/foo/bar | /foo | /xyz | /xyz/bar |
/foo/bar | /foo | /xyz/ | /xyz/bar |
/foo/bar | /foo/ | /xyz | /xyz/bar |
/foo/bar | /foo/ | /xyz/ | /xyz/bar |
/foo | /foo | /xyz | /xyz |
/foo/ | /foo | /xyz | /xyz/ |
/foo/bar | /foo | empty string | /bar |
/foo/ | /foo | empty string | / |
/foo | /foo | empty string | / |
/foo/ | /foo | / | / |
/foo | /foo | / | / |
Trait Implementations§
source§impl Clone for HttpPathModifier
impl Clone for HttpPathModifier
source§fn clone(&self) -> HttpPathModifier
fn clone(&self) -> HttpPathModifier
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HttpPathModifier
impl Debug for HttpPathModifier
source§impl<'de> Deserialize<'de> for HttpPathModifier
impl<'de> Deserialize<'de> for HttpPathModifier
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 JsonSchema for HttpPathModifier
impl JsonSchema for HttpPathModifier
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl PartialEq for HttpPathModifier
impl PartialEq for HttpPathModifier
source§fn eq(&self, other: &HttpPathModifier) -> bool
fn eq(&self, other: &HttpPathModifier) -> bool
self
and other
values to be equal, and is used
by ==
.