Compare commits
2 commits
218db3a175
...
2f8920eefe
Author | SHA1 | Date | |
---|---|---|---|
2f8920eefe | |||
a6576f1947 |
2 changed files with 5 additions and 2 deletions
|
@ -109,5 +109,7 @@ async fn main() -> Result<(), PostWomanError> {
|
||||||
// },
|
// },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eprintln!();
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,13 +152,14 @@ impl Endpoint {
|
||||||
StringOr::Str(_query) => todo!(),
|
StringOr::Str(_query) => todo!(),
|
||||||
StringOr::T(Extractor::Discard) => "".to_string(),
|
StringOr::T(Extractor::Discard) => "".to_string(),
|
||||||
StringOr::T(Extractor::Debug) => format!("{res:#?}\n"),
|
StringOr::T(Extractor::Debug) => format!("{res:#?}\n"),
|
||||||
StringOr::T(Extractor::Body) => res.text().await?,
|
StringOr::T(Extractor::Body) => res.text().await? + "\n",
|
||||||
StringOr::T(Extractor::Header { key }) => res
|
StringOr::T(Extractor::Header { key }) => res
|
||||||
.headers()
|
.headers()
|
||||||
.get(&key)
|
.get(&key)
|
||||||
.ok_or(PostWomanError::HeaderNotFound(key))?
|
.ok_or(PostWomanError::HeaderNotFound(key))?
|
||||||
.to_str()?
|
.to_str()?
|
||||||
.to_string(),
|
.to_string()
|
||||||
|
+ "\n",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue