Treat zero-length input as no input at all
Fixes running with molly brown
This commit is contained in:
parent
de060363f1
commit
6400197514
|
@ -62,7 +62,7 @@ impl Request {
|
||||||
|
|
||||||
uri.normalize();
|
uri.normalize();
|
||||||
|
|
||||||
let input = match uri.query() {
|
let input = match uri.query().filter(|q| !q.is_empty()) {
|
||||||
None => None,
|
None => None,
|
||||||
Some(query) => {
|
Some(query) => {
|
||||||
let input = percent_decode_str(query.as_str())
|
let input = percent_decode_str(query.as_str())
|
||||||
|
@ -126,6 +126,11 @@ impl Request {
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// View any input sent by the user in the query string
|
||||||
|
///
|
||||||
|
/// Any zero-length input is treated as no input at all, and will be reported as
|
||||||
|
/// [`None`]. This is done in order to provide compatibility with the SCGI header
|
||||||
|
/// common practice of reporting no query string as a blank input.
|
||||||
pub fn input(&self) -> Option<&str> {
|
pub fn input(&self) -> Option<&str> {
|
||||||
self.input.as_deref()
|
self.input.as_deref()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue