| author | |
| committer | |
| log | 0d25302d43557d89b868b8925b2e98395d1ebe60 |
| tree | fdac48106d75cae799a834183e3471e48acd1ee6 |
| parent | a85495ca22e5410df00a59fe82fe480645ca3f85 |
RFC 9110 says
> It is RECOMMENDED that all senders and recipients support, at a minimum,
> URIs with lengths of 8000 octets in protocol elements.
closes #302072 files changed, 4 insertions(+), 3 deletions(-)
lib/std/http/Client.zig+3-2| ... | ... | @@ -1126,7 +1126,7 @@ pub const Request = struct { |
| 1126 | 1126 | /// `redirect_buffer` must outlive accesses to `Request.uri`. If this |
| 1127 | 1127 | /// buffer capacity would be exceeded, `error.HttpRedirectLocationOversize` |
| 1128 | 1128 | /// is returned instead. This buffer may be empty if no redirects are to be |
| 1129 | /// handled. | |
| 1129 | /// handled. RFC 9110 recommends making this at least 8000 bytes. | |
| 1130 | 1130 | /// |
| 1131 | 1131 | /// If this fails with `error.ReadFailed` then the `Connection.getReadError` |
| 1132 | 1132 | /// method of `r.connection` can be used to get more detailed information. |
| ... | ... | @@ -1748,7 +1748,8 @@ pub fn request( |
| 1748 | 1748 | } |
| 1749 | 1749 | |
| 1750 | 1750 | pub const FetchOptions = struct { |
| 1751 | /// `null` means it will be heap-allocated. | |
| 1751 | /// `null` means it will be heap-allocated. RFC 9110 recommends at least | |
| 1752 | /// 8000 bytes. | |
| 1752 | 1753 | redirect_buffer: ?[]u8 = null, |
| 1753 | 1754 | /// `null` means it will be heap-allocated. |
| 1754 | 1755 | decompress_buffer: ?[]u8 = null, |
src/Package/Fetch.zig+1-1| ... | ... | @@ -1193,7 +1193,7 @@ fn initResource(f: *Fetch, uri: std.Uri, resource: *Resource, reader_buffer: []u |
| 1193 | 1193 | request.sendBodiless() catch |err| |
| 1194 | 1194 | return f.fail(f.location_tok, try eb.printString("HTTP request failed: {t}", .{err})); |
| 1195 | 1195 | |
| 1196 | var redirect_buffer: [1024]u8 = undefined; | |
| 1196 | var redirect_buffer: [8000]u8 = undefined; | |
| 1197 | 1197 | const response = &resource.http_request.response; |
| 1198 | 1198 | response.* = request.receiveHead(&redirect_buffer) catch |err| switch (err) { |
| 1199 | 1199 | error.ReadFailed => { |