aboutsummaryrefslogtreecommitdiff
path: root/lib/std/http/Client.zig
AgeCommit message (Collapse)Author
2025-10-29std: fix macos compilation errorsAndrew Kelley
2025-10-29compiler: update for introduction of std.IoAndrew Kelley
only thing remaining is using libc dns resolution when linking libc
2025-10-29std.Uri: fix compilation errorAndrew Kelley
2025-10-29std.crypto.Certificate.Bundle: remove use of File.readAllAndrew Kelley
2025-10-29std: fix some Io compilation errorsAndrew Kelley
2025-10-29std.Io: bring back Timestamp but also keep Clock.TimestampAndrew Kelley
this feels better
2025-10-29std: updating to std.Io interfaceAndrew Kelley
got the build runner compiling
2025-10-29WIP: hack away at std.Io return flightAndrew Kelley
2025-10-29std.Io.net: partially implement HostName.lookupAndrew Kelley
2025-09-06std.http.Client.Connection: make host() publicbaltevl
Closes #25153
2025-09-05remove ResponseStoragerpkak
unused since 5ce8e9325b7aa15cbcc77221fc7075b6c46619cc
2025-08-31Fix regression: std.http.Client basic authorization sending user:user ↵Tadej Gašparovič
instead of user:password when passed in URI
2025-08-22Merge pull request #24926 from mrjbq7/http-fetchJohn Benediktsson
http.Client: don't forget to flush
2025-08-18std.http.Client: discard response body when reusing connectionAndrew Kelley
When an error response was encountered, such as 404 not found, the body wasn't discarded, leading to the string "404 not found" being incorrectly interpreted as the next request's response. closes #24732
2025-08-16Merge pull request #24864 from ifreund/fix-std-cmdAndrew Kelley
http.BodyWriter: handle EOF in chunkedSendFile, simplify
2025-08-16http.BodyWriter: handle EOF in chunkedSendFile, simplifyIsaac Freund
With these changes, the `zig std` command now works again and doesn't trigger assertion failures or mess up the chunked transfer encoding.
2025-08-16std: more reliable HTTP and TLS networkingAndrew Kelley
* std.Io.Reader: fix confused semantics of rebase. Before it was ambiguous whether it was supposed to be based on end or seek. Now it is clearly based on seek, with an added assertion for clarity. * std.crypto.tls.Client: fix panic due to not enough buffer size available. Also, avoid unnecessary rebasing. * std.http.Reader: introduce max_head_len to limit HTTP header length. This prevents crash in underlying reader which may require a minimum buffer length. * std.http.Client: choose better buffer sizes for streams and TLS client. Crucially, the buffer shared by HTTP reader and TLS client needs to be big enough for all http headers *and* the max TLS record size. Bump HTTP header size default from 4K to 8K. fixes #24872 I have noticed however that there are still fetch problems
2025-08-07Fetch: handle compressed git+httpAndrew Kelley
2025-08-07std.http.Client: fix fetching by adding a bufferAndrew Kelley
2025-08-07TLS, HTTP, and package fetching fixesAndrew Kelley
* TLS: add missing assert for output buffer length requirement * TLS: add missing flushes * TLS: add flush implementation * TLS: finish drain implementation * HTTP: correct buffer sizes for TLS * HTTP: expose a getReadError method on Connection * HTTP: add missing flush on sendBodyComplete * Fetch: remove unwanted deinit * Fetch: improve error reporting
2025-08-07std.http: remove custom method supportAndrew Kelley
let's see if anybody notices it missing
2025-08-07std.http: address review commentsAndrew Kelley
thank you everybody
2025-08-07std.http.Server: add safety for invalidated Head stringsAndrew Kelley
and fix bad unit test API usage that it finds
2025-08-07fix 32-bit buildsAndrew Kelley
2025-08-07fetch: update for new http APIAndrew Kelley
it's not quite finished because I need to make it not copy the Resource
2025-08-07http fixesAndrew Kelley
2025-08-07std.http: rework for new std.Io APIAndrew Kelley
2025-07-31compiler: update to new flate APIAndrew Kelley
2025-07-31std.compress: rework flate to new I/O APIAndrew Kelley
2025-07-09eliminate all uses of std.io.Writer.count except for CBEAndrew Kelley
2025-07-07std.fmt: fully remove format string from format methodsAndrew Kelley
Introduces `std.fmt.alt` which is a helper for calling alternate format methods besides one named "format".
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
2025-07-07std.io: deprecated Reader/Writer; introduce new APIAndrew Kelley
2025-05-28x86_64: implement integer `@reduce(.Add)`Jacob Young
2025-04-27chore(std.mem): Rename `trimLeft` and `trimRight`Shun Sakai
Rename `trimLeft` to `trimStart`, and `trimRight` to `trimEnd`. `trimLeft` and `trimRight` functions remain as deprecated aliases for these new names.
2025-04-03std.DoublyLinkedList: remove length trackingAndrew Kelley
this is trivial to tack on, and in my experience it is rarely wanted.
2025-03-14lib/std/http/Client.zig: Ignore empty proxy environment variables (#23223)Elijah M. Immer
This fixes #21032 by ignoring proxy environment variables that are empty.
2025-02-22zig build fmtAndrew Kelley
2025-02-22std/http/Client: Remove TODO comments on indentation87flowers
2024-11-07std.http.Client: change ssl key log creation permission bitsJacob Young
This is the same mode used by openssh for private keys. This does not change the mode of an existing file, so users who need something different can pre-create the file with their designed permissions or change them after the fact, and running another process that writes to the key log will not change it back.
2024-11-07std.crypto.tls: improve debuggability of encrypted connectionsJacob Young
By default, programs built in debug mode that open a https connection will append secrets to the file specified in the SSLKEYLOGFILE environment variable to allow protocol debugging by external programs.
2024-04-28std.posix.iovec: use .base and .len instead of .iov_base and .iov_lenNameless
2024-04-22ComptimeStringMap: return a regular struct and optimizeTravis Staloch
this patch renames ComptimeStringMap to StaticStringMap, makes it accept only a single type parameter, and return a known struct type instead of an anonymous struct. initial motivation for these changes was to reduce the 'very long type names' issue described here https://github.com/ziglang/zig/pull/19682. this breaks the previous API. users will now need to write: `const map = std.StaticStringMap(T).initComptime(kvs_list);` * move `kvs_list` param from type param to an `initComptime()` param * new public methods * `keys()`, `values()` helpers * `init(allocator)`, `deinit(allocator)` for runtime data * `getLongestPrefix(str)`, `getLongestPrefixIndex(str)` - i'm not sure these belong but have left in for now incase they are deemed useful * performance notes: * i posted some benchmarking results here: https://github.com/travisstaloch/comptime-string-map-revised/issues/1 * i noticed a speedup reducing the size of the struct from 48 to 32 bytes and thus use u32s instead of usize for all length fields * i noticed speedup storing KVs as a struct of arrays * latest benchmark shows these wall_time improvements for debug/safe/small/fast builds: -6.6% / -10.2% / -19.1% / -8.9%. full output in link above.
2024-04-12Revert "std.http.Client: always omit port when it matches default"Andrew Kelley
This reverts commit db0a42b558c64eac2b4e41d02b078931b0c63af8, but keeps the changes to std/Uri.zig.
2024-04-12std.http.Client: always omit port when it matches defaultAndrew Kelley
This makes the host http header have the port if and only if it differs from the defaults based on the protocol. This is an alternate implementation that closes #19624.
2024-04-12std.http.Client: pass port to server based on user inputAndrew Kelley
This makes the host http header have the port if and only if the URI provided by the API user included it. Closes #19624
2024-04-10Uri: propagate per-component encodingJacob Young
This allows `std.Uri.resolve_inplace` to properly preserve the fact that `new` is already escaped but `base` may not be. I originally tried just moving `raw_uri` around, but it made uri resolution unmanagably complicated, so I instead added per-component information to `Uri` which allows extra allocations to be avoided when constructing uris with components from different sources, and in some cases, deferring the work all the way to when the uri is printed, where an allocator may not even be needed. Closes #19587
2024-03-30Update uses of `@fieldParentPtr` to use RLSJacob Young
2024-03-30Update uses of `@fieldParentPtr` to pass a pointer typeJacob Young
2024-03-19extract std.posix from std.osAndrew Kelley
closes #5019