Releases: theoriclabs/leanhttp
Releases · theoriclabs/leanhttp
Release list
LeanHttp 0.4.0
Added
LeanHttp.WebSocket: aws://andwss://client over libcurl's WebSocket
API (libcurl 7.86 and later).connect,withConnection,Connection.send,
recv,pingandclose, withconnectAsync,Connection.sendAsyncand
Connection.recvAsyncplus the matchingTaskvariants for blocking calls on
dedicated workers. TLS policy, proxies, user agent and default headers come
fromSession.Config; subprotocols and extra handshake headers come from
WebSocket.Options.- Messages, close codes, receive limits and fragment reassembly are
leanws types, so LeanHttp and
LeanWs.Clientpresent the sameLeanWs.Messagevalues. leanws is a new
package dependency. WebSocket.supportedand theError.Kind.websocketUnsupportedcase report a
libcurl without WebSocket support, distinguishing it from a transport failure.
Error.Kind.websocketProtocolreports handshake and RFC 6455 failures,
including a message overOptions.limits, which also closes with1009.Target.resolveInresolves a target against an explicit scheme set, with
Target.httpSchemesandTarget.webSocketSchemes.Target.resolvekeeps its
HTTP behavior.
Fixed
- Requests set
CURLOPT_PATH_AS_IS, so a percent-encoded%2Epath segment
stays data. libcurl 8.10 and later decode it and then apply dot-segment
removal, which turned.segment "."into directory navigation on the wire.
Target.resolvealready performs RFC 3986 dot-segment removal itself.
Documentation
- The README opens with an install and quick-start path, carries a table of
contents, and documents everyError.Kindcase and itsSslFailuredetail in
one table.
Compatibility
- Additive except for
Error.Kind, which gained two cases; exhaustive matches
over it need updating. libcurl without WebSocket support keeps serving every
HTTP request and degrades to the typed.websocketUnsupportederror. - Building LeanHttp now resolves one dependency, leanws
v0.1.0, from
https://github.com/theoriclabs/leanws. Consumers pin leanhttp as before. - The package version and default user agent are now
0.4.0and
leanhttp/0.4.0.
LeanHttp 0.3.1
Fixed
Request.segmentandTarget.segmentencode literal.and..values as
path data. Previously, resolution or libcurl could interpret a dynamic
identifier as current- or parent-directory navigation.- Relative target serialization preserves relative meaning for first segments
containing:, leading empty segments, and an appended empty segment. It adds
a dot prefix when needed instead of producing an absolute or scheme-relative
reference, or dropping the distinction between an empty segment and no path. - Relative fragments are percent-encoded on serialization, so spaces,
#,
Unicode, and literal percent characters round-trip through target parsing. Target.resolveremoves literal dot segments from absolute target paths,
matching its behavior for nonempty relative paths and preserving encoded dots.
Compatibility
- Public API signatures are unchanged. For intentional directory navigation,
use reference syntax such astarget!"../users";.segment ".."now always
supplies a literal path segment. - The package version and default user agent are now
0.3.1andleanhttp/0.3.1.
LeanHttp 0.3.0
Added
- Inductive absolute/relative
Targetvalues,RelativeRef, checkedtarget!
literals, dynamic target parsing, and pure resolution with typed errors. - Relative paths, directory merging, dot-segment removal, and explicit omitted
versus empty query semantics for session base URIs. requestAsyncandrequestAsAsyncintegration withStd.Async, using a
dedicated worker and session for each one-shot request.requestAsTaskand bounded batch APIs:requestManyTask,requestManyAsTask,
requestManyAsync, andrequestManyAsAsync.- A strictly positive
Concurrencytype andBatch.Config. Batch workers reuse
their own sessions, consume a shared queue, and preserve input result order. - Optional session configuration for
request,requestAs, andrequestTask. - A design proposal covering target semantics, async scheduling, ownership,
timeout behavior, cancellation limits, and future backend choices. - Regression tests for target resolution, async overlap, concurrency bounds,
connection reuse, result ordering, independent failure handling, and loader
failures in batches.
Changed
Request.urinow has typeTarget. Existing URI arguments coerce to
.absolute; code inspecting the field must handle the two target cases or
resolve it first.Response.effectiveUriremains aStd.Http.URI.- Request constructors and URI-taking request helpers accept
Target. - Absolute requests must have an HTTP(S) scheme, authority, and an empty or
slash-prefixed path. They no longer inherit the base merely because an
authority was absent. Use an explicit
relative target for base-URI requests. Scheme-relative//host/pathtargets
are rejected; changing authority requires an explicit absolute URI. - The package version and default user agent are now
0.3.0andleanhttp/0.3.0.
Async behavior
- Transfers use blocking libcurl on dedicated threads. Async waits suspend
through Lean's task scheduler; batches bound worker threads and sessions. - Timeouts start at transfer execution, excluding batch queue time.
- Dropping a task or abandoning an async branch does not cancel a transfer.
Workers close their sessions after completion or timeout. Persistent pools,
streaming, and transfer cancellation are deferred.
LeanHttp 0.2.0
Added
- Composable request constructors for GET, POST, PUT, PATCH, DELETE, and HEAD,
with JSON, authentication, header, path-segment, and query-parameter helpers. Body.ofJsonandRequest.jsonfor values withLean.ToJsoninstances.- Compile-time checked
uri!,headerName!, andheaderValue!literals,
enabled by openingLeanHttpor its scoped syntax. Session.requestAsandLeanHttp.requestAsfor decoding fully configured
requests, plusResponse.decodeAsfor existing responses.ToBodyinstances forBodyandUnit, allowing explicit bodies and empty
payloads inSession.exchange.LeanHttp.packageVersion, used in the default user agent.- Regression coverage for checked literals, query encoding, method preservation,
typed request settings, decoding failures, and session reuse.
Fixed
- Requests with a GET method and a body now reach the server as GET, preserving
the payload. Previously, setting the body caused libcurl to send POST. - Supplying a body to HEAD no longer changes the method to POST or enables
response-body downloads. libcurl's HEAD behavior does not send that payload. - The new query helper preserves literal
+characters in names and values,
working around the query-encoding behavior in Lean 4.33.0. Repeated parameters
retain their order.
Changed
Session.getAsandSession.exchangeshare the same status and decoding
implementation asSession.requestAs, preserving their existing signatures.- The default user agent is now
leanhttp/0.2.0. Session.Config.userAgentandOpt.userAgentnow require a validated
Std.Http.Header.Valueinstead ofString. Migrate custom agents to
headerValue!"my-client/1.0"; validate dynamic values with
Std.Http.Header.Value.ofString?. This excludes CR, LF, and NUL before the FFI.- Installation examples pin the release tag instead of
main.