feat(fetch) add redirect: 'error' support (#2845)

* add redirect: 'error' support

* fix typo

* fix typo

* refactor FetchRedirect enum

* fix FetchRedirect

* updated
This commit is contained in:
Ciro Spaciari
2023-05-11 03:55:39 -03:00
committed by GitHub
parent 8f4a5903ab
commit f9831e1f6f
7 changed files with 165 additions and 134 deletions

View File

@@ -187,17 +187,7 @@ pub fn main() anyerror!void {
var ctx = try default_allocator.create(HTTP.HTTPChannelContext);
ctx.* = .{
.channel = channel,
.http = try HTTP.AsyncHTTP.init(
default_allocator,
args.method,
args.url,
args.headers,
args.headers_buf,
response_body_string,
args.body,
0,
),
.http = try HTTP.AsyncHTTP.init(default_allocator, args.method, args.url, args.headers, args.headers_buf, response_body_string, args.body, 0, HTTP.FetchRedirect.follow),
};
ctx.http.callback = HTTP.HTTPChannelContext.callback;
var batch = HTTPThread.Batch{};