docs: drop the predecessor comparisons from comments and tests

This commit is contained in:
randogoth 2026-10-06 10:27:46 +03:00
parent 36faa4fb93
commit 19e7cfaca3
19 changed files with 65 additions and 73 deletions

View file

@ -32,7 +32,8 @@ pub fn serve(listener: &Listener, mut stream: TcpStream) -> Result<()> {
if !version.starts_with("HTTP/1.") {
return bad_request(&mut stream);
}
// Origin-form only. smolweb's `urlsplit` would have mishandled the others.
// Origin-form only; the other request-target forms are refused, not
// half-supported.
if !target.starts_with('/') {
return bad_request(&mut stream);
}
@ -168,8 +169,8 @@ pub fn serve(listener: &Listener, mut stream: TcpStream) -> Result<()> {
write_head(&mut stream, 200, "OK", media_type, meta.len(), &[])?;
if !head_only {
let mut file = std::fs::File::open(&path)?;
// Streamed, not buffered: smolweb reads the whole file into
// memory on every request.
// Streamed, not buffered, so a large file costs the copy buffer
// rather than its own size on every request.
std::io::copy(&mut file, &mut stream)?;
}
Ok(())