1
0
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:
Alexander Medvednikov
2019-11-30 15:27:16 +03:00
parent 2651b8957a
commit a23a4ed98a
4 changed files with 20 additions and 18 deletions

View File

@ -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 {