Switched to patch-based builder, based on weekly

This commit is contained in:
Jef Roosens 2022-01-27 19:18:11 +01:00
commit 78e343fae2
Signed by untrusted user: Jef Roosens
GPG key ID: 955C0660072F691F
15 changed files with 177 additions and 49 deletions

View file

@ -0,0 +1,23 @@
// Parse the header of a raw HTTP request into a Request object
pub fn parse_request_head(mut reader io.BufferedReader) ?Request {
// request line
mut line := reader.read_line() ?
method, target, version := parse_request_line(line) ?
// headers
mut header := new_header()
line = reader.read_line() ?
for line != '' {
key, value := parse_header(line) ?
header.add_custom(key, value) ?
line = reader.read_line() ?
}
header.coerce(canonicalize: true)
return Request{
method: method
url: target.str()
header: header
version: version
}
}

7
patches/patch.sh Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env sh
# This file patches the downloaded V version
# Should be run from within the directory it's in, as it uses relative paths to the files used for patching.
# $1 is the path to the downloaded V version
# Add parse_request_no_body
cat parse_request_no_body.v >> "$1"/vlib/net/http/request.v