1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

net.http: refactor the Response struct (#10922)

This commit is contained in:
Miccah
2021-07-24 12:47:45 -05:00
committed by GitHub
parent 3979e5c5ff
commit a0e27d3fd9
10 changed files with 242 additions and 160 deletions

View File

@ -56,7 +56,9 @@ pub fn (req &Request) do() ?Response {
}
qresp := req.method_and_url_to_response(req.method, rurl) ?
resp = qresp
if resp.status_code !in [301, 302, 303, 307, 308] {
if resp.status() !in [.moved_permanently, .found, .see_other, .temporary_redirect,
.permanent_redirect,
] {
break
}
// follow any redirects