forked from vieter-v/vieter
Switched to patch-based builder, based on weekly
This commit is contained in:
commit
78e343fae2
15 changed files with 177 additions and 49 deletions
23
patches/parse_request_no_body.v
Normal file
23
patches/parse_request_no_body.v
Normal 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
7
patches/patch.sh
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue