Fixed bug where incorrect timeout was used. I got the mime types backwards haha pretend you didnt see that
This commit is contained in:
parent
25d575bee7
commit
df362d1bc3
15
src/lib.rs
15
src/lib.rs
|
@ -128,15 +128,16 @@ impl Server {
|
||||||
// body, and flush all as one timeout)
|
// body, and flush all as one timeout)
|
||||||
//
|
//
|
||||||
// The split between the two cases happens at this very first if block.
|
// The split between the two cases happens at this very first if block.
|
||||||
// Everything in this deep chain of if's and if-let's is for the special case. If
|
// Everything in this if is for the special case. If any one of the ifs fails,
|
||||||
// any one of the ifs fails, the code after the big if block is run, and that's
|
// the code after the big if block is run, and that's the normal case.
|
||||||
// the normal case.
|
|
||||||
//
|
//
|
||||||
// Hope this helps! Emi <3
|
// Hope this helps! Emi <3
|
||||||
|
|
||||||
if header.status == Status::SUCCESS && maybe_body.is_some() {
|
if header.status == Status::SUCCESS &&
|
||||||
// aaaa let me have if-let chaining ;_;
|
maybe_body.is_some() &&
|
||||||
if let "text/plain"|"text/gemini" = header.meta.as_str() {
|
header.meta.as_str() != "text/plain" &&
|
||||||
|
header.meta.as_str() != "text/gemini"
|
||||||
|
{
|
||||||
if let Some(cplx_timeout) = self.complex_timeout {
|
if let Some(cplx_timeout) = self.complex_timeout {
|
||||||
|
|
||||||
|
|
||||||
|
@ -168,10 +169,10 @@ impl Server {
|
||||||
.await
|
.await
|
||||||
.context("Timed out while sending response body")??;
|
.context("Timed out while sending response body")??;
|
||||||
|
|
||||||
|
|
||||||
return Ok(())
|
return Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///////////// Use the normal timeout /////////////////////////////////////////////
|
///////////// Use the normal timeout /////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue