mirror of
https://github.com/ziglang/zig.git
synced 2024-11-21 19:42:56 +00:00
make server_header_buffer non-optional
This commit is contained in:
parent
72cd507f3f
commit
161e796d6f
@ -1666,7 +1666,7 @@ pub fn open(
|
||||
}
|
||||
|
||||
pub const FetchOptions = struct {
|
||||
server_header_buffer: ?[]u8 = null,
|
||||
server_header_buffer: []u8,
|
||||
redirect_behavior: ?Request.RedirectBehavior = null,
|
||||
|
||||
/// If the server sends a body, it will be appended to this ArrayList.
|
||||
@ -1712,13 +1712,11 @@ pub fn fetch(client: *Client, options: FetchOptions) !Response {
|
||||
.url => |u| try Uri.parse(u),
|
||||
.uri => |u| u,
|
||||
};
|
||||
var server_header_buffer: [16 * 1024]u8 = undefined;
|
||||
|
||||
const method: http.Method = options.method orelse
|
||||
if (options.payload != null) .POST else .GET;
|
||||
|
||||
var req = try open(client, method, uri, .{
|
||||
.server_header_buffer = options.server_header_buffer orelse &server_header_buffer,
|
||||
.server_header_buffer = options.server_header_buffer,
|
||||
.redirect_behavior = options.redirect_behavior orelse
|
||||
if (options.payload == null) @enumFromInt(3) else .unhandled,
|
||||
.headers = options.headers,
|
||||
|
Loading…
Reference in New Issue
Block a user