mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
update all index() uses
This commit is contained in:
@ -185,18 +185,17 @@ fn parse_response(resp string) Response {
|
||||
break
|
||||
}
|
||||
i++
|
||||
pos := h.index(':')
|
||||
if pos == -1 {
|
||||
pos := h.index(':') or {
|
||||
continue
|
||||
}
|
||||
//if h.contains('Content-Type') {
|
||||
//continue
|
||||
//}
|
||||
key := h[..pos]
|
||||
val := h[pos + 2..]
|
||||
val := h[pos+2..]
|
||||
headers[key] = val.trim_space()
|
||||
}
|
||||
|
||||
|
||||
if headers['Transfer-Encoding'] == 'chunked' {
|
||||
text = chunked.decode( text )
|
||||
}
|
||||
@ -211,7 +210,7 @@ fn parse_response(resp string) Response {
|
||||
fn (req &Request) build_request_headers(method, host_name, path string) string {
|
||||
ua := req.user_agent
|
||||
mut uheaders := []string
|
||||
for key, val in req.headers {
|
||||
for key, val in req.headers {
|
||||
uheaders << '${key}: ${val}\r\n'
|
||||
}
|
||||
if req.data.len > 0 {
|
||||
|
Reference in New Issue
Block a user