aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-01-04 18:28:37 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-01-04 18:37:53 -0700
commit8248fdbbdb88cc861c3d02a26ec4a214df3f9a1e (patch)
tree1064a9a537b57cf83fe9a496594e831eff188585 /src/Module.zig
parent079f62881ee8291e1b290848c1081c822ea8389f (diff)
downloadzig-8248fdbbdb88cc861c3d02a26ec4a214df3f9a1e.tar.gz
zig-8248fdbbdb88cc861c3d02a26ec4a214df3f9a1e.zip
std.http.Client: support HTTP redirects
* std.http.Status.Class: add a "nonstandard" enum tag. Instead of having `class` return an optional value, it can potentially return nonstandard. * extract out std.http.Client.Connection from std.http.Client.Request - this code abstracts over plain/TLS only - this is the type that will potentially be stored in a client's LRU connection map * introduce two-staged HTTP header parsing - API users can rely on a heap-allocated buffer with a maximum limit, which defaults to 16 KB, or they can provide a static buffer that is borrowed by the Request instance. - The entire HTTP header is buffered because there are strings in there and they must be accessed later, such as with the case of HTTP redirects. - When buffering the HTTP header, the parser only looks for the \r\n\r\n pattern. Further validation is done later. - After the full HTTP header is buffered, it is parsed into components such as Content-Length and Location. * HTTP redirects are handled, with a maximum redirect count option that defaults to 3. - Connection: close is always used for now; implementing keep-alive connections and an LRU connection pool in std.http.Client is a task for another day. see #2007
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions