1
Fork 0

net::http::do: assert http

Until we implement TLS
This commit is contained in:
Drew DeVault 2023-02-10 10:16:18 +01:00
parent 26b21689b5
commit 8ccb846c55

View file

@ -22,6 +22,7 @@ export fn do(client: *client, req: *request) (response | error) = {
};
defer free(ctx.buf);
assert(req.target.scheme == "http"); // TODO: https
const conn = dial::dial_uri("tcp", req.target)?;
ctx.file = bufio::buffered(conn, [], ctx.buf);
bufio::setflush(&ctx.file, []);