pub enum UrlStrategy {
PercentEncodeAggressive,
DoublePercentEncode,
NonCanonicalSpaces,
Hpp,
}Expand description
Per-value mutation choice.
Variants§
PercentEncodeAggressive
Percent-encode every byte that isn’t alphanumeric. Most signatures match decoded payloads but verify by raw-byte regex — this breaks both checks at once.
DoublePercentEncode
Double-percent-encode (% → %25, then percent-encode again).
Bypasses URL-decode-then-match WAFs that decode exactly once.
NonCanonicalSpaces
Mix in + for spaces, 0x2F for /, etc. — non-canonical
encodings that some upstream parsers normalise but signatures
don’t.
Hpp
Insert empty PHP-style array brackets [] after the param name
to force HTTP Parameter Pollution path. Only meaningful when
the name needs to change; otherwise no-op.
Implementations§
Source§impl UrlStrategy
impl UrlStrategy
Sourcepub fn apply(self, value: &str) -> String
pub fn apply(self, value: &str) -> String
Apply the strategy to a single decoded value, returning the mutated raw form (already URL-safe — caller does not re-encode).
Sourcepub fn apply_bytes(self, value: &[u8]) -> String
pub fn apply_bytes(self, value: &[u8]) -> String
Byte-clean variant of Self::apply for percent-encoding
strategies. Lets callers run a non-UTF-8 byte sequence (e.g.
the raw bytes from a percent-decode on %FF%FE) through the
pipeline without it being silently rewritten to U+FFFD by
String::from_utf8_lossy. Each strategy that only operates
on bytes (PercentEncodeAggressive, DoublePercentEncode) is
byte-pure here. Strategies that need character semantics
(NonCanonicalSpaces) lossy-convert internally.
Trait Implementations§
Source§impl Clone for UrlStrategy
impl Clone for UrlStrategy
Source§fn clone(&self) -> UrlStrategy
fn clone(&self) -> UrlStrategy
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 UrlStrategy
impl Debug for UrlStrategy
Source§impl PartialEq for UrlStrategy
impl PartialEq for UrlStrategy
Source§fn eq(&self, other: &UrlStrategy) -> bool
fn eq(&self, other: &UrlStrategy) -> bool
self and other values to be equal, and is used by ==.impl Copy for UrlStrategy
impl Eq for UrlStrategy
impl StructuralPartialEq for UrlStrategy
Auto Trait Implementations§
impl Freeze for UrlStrategy
impl RefUnwindSafe for UrlStrategy
impl Send for UrlStrategy
impl Sync for UrlStrategy
impl Unpin for UrlStrategy
impl UnsafeUnpin for UrlStrategy
impl UnwindSafe for UrlStrategy
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<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.