Fix /joke
This commit is contained in:
parent
ba70c61bc4
commit
a4197bc5af
1 changed files with 7 additions and 1 deletions
|
@ -5,7 +5,13 @@ use eyre::Result;
|
|||
const DADJOKE: &str = "https://icanhazdadjoke.com";
|
||||
|
||||
pub async fn get_joke(http: &HttpClient) -> Result<String> {
|
||||
let joke = http.get_request(DADJOKE).await?.text().await?;
|
||||
let joke = http
|
||||
.get(DADJOKE)
|
||||
.header("Accept", "text/plain")
|
||||
.send()
|
||||
.await?
|
||||
.text()
|
||||
.await?;
|
||||
|
||||
Ok(joke)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue