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();
|
||||
|
||||
let input = match uri.query() {
|
||||
let input = match uri.query().filter(|q| !q.is_empty()) {
|
||||
None => None,
|
||||
Some(query) => {
|
||||
let input = percent_decode_str(query.as_str())
|
||||
|
@ -126,6 +126,11 @@ impl Request {
|
|||
.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> {
|
||||
self.input.as_deref()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue