From 14c5c2f4686d260b43d602f0c01ed0b760eabbd1 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Wed, 10 Jul 2024 10:08:21 +0300 Subject: Release 0.4.0 --- README.org | 2 ++ build.zig.zon | 10 +++++----- src/EasyHttp.zig | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index dc07339..7c46082 100644 --- a/README.org +++ b/README.org @@ -22,6 +22,8 @@ newer (hopefully the newest!) Zig version that should enable you to compile the | 0.10.0 | 0.2.1 | | 0.10.1 | 0.2.1 | | 0.11.0 | 0.3.0 | +| 0.12.0 | 0.4.0 | +| 0.12.1 | 0.4.0 | | master | main | * How diff --git a/build.zig.zon b/build.zig.zon index 1195e7a..aed6a59 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -5,16 +5,16 @@ .paths = .{""}, .dependencies = .{ .clap = .{ - .url = "https://git.enes.lv/zig-clap/snapshot/zig-clap-4267b0b60ef6f87cccf3ee6ed481e6d0759180c6.tar.xz", - .hash = "12202fa30d679d821292bcd953458b9e76097a5d16999489125a206db63a53392833", + .url = "https://git.enes.lv/zig-clap/snapshot/zig-clap-0.8.0.tar.xz", + .hash = "1220949d4e88864579067b6d4cdad6476c6176f27e782782c2c39b7f2c4817a10efb", }, .libarchive = .{ - .url = "https://git.enes.lv/zig-libarchive/snapshot/zig-libarchive-7d3a63d5e05787847e5a199ffdd5bad99e7dbd7a.tar.xz", + .url = "https://git.enes.lv/zig-libarchive/snapshot/zig-libarchive-0.3.0.tar.xz", .hash = "1220d8262d35559168d67d60797829a36958320556b277cd0e701a34eb00880461ab", }, .xdg = .{ - .url = "https://git.enes.lv/zig-xdg/snapshot/zig-xdg-1e925ee081a4880ad895c3976bd6e1d1061a4040.tar.xz", - .hash = "122022d632b2ca6fd959b31748b3a4a7404d391abfae9b297bb3ce29045ae27e5568", + .url = "https://git.enes.lv/zig-xdg/snapshot/zig-xdg-0.3.0.tar.xz", + .hash = "1220e214475ea8ff31ac110f593be121663eefdca27d19508d0c96bc49f47c31756f", }, }, } diff --git a/src/EasyHttp.zig b/src/EasyHttp.zig index 10dcd0c..28228a7 100644 --- a/src/EasyHttp.zig +++ b/src/EasyHttp.zig @@ -3,7 +3,6 @@ const std = @import("std"); const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator; const Client = std.http.Client; -const Headers = std.http.Headers; const Reader = Request.Reader; const Request = Client.Request; const Uri = std.Uri; @@ -19,13 +18,14 @@ pub fn get(parent_allocator: Allocator, uri: Uri) ![]u8 { }; defer client.deinit(); - var headers = Headers.init(allocator); - defer headers.deinit(); + var server_header_buffer: [4096]u8 = undefined; - var request = try client.open(.GET, uri, headers, .{}); + var request = try client.open(.GET, uri, .{ + .server_header_buffer = &server_header_buffer, + }); defer request.deinit(); - try request.send(.{}); + try request.send(); try request.wait(); return request.reader().readAllAlloc(parent_allocator, std.math.maxInt(usize)); -- cgit v1.2.3