-
v2.0.0 Stable
released this
2026-07-25 20:24:51 +02:00 | 1 commits to main since this releaseBreaking changes
http.get/post/put(url, [body], opts)-- headers parameter replaced by
anoptstable:{ timeout = <seconds>, headers = <table, optional> }.
timeoutis required, no default.http.get/post/put/get_rawnow return{ body, status, headers }, nil
on success ornil, erron failure, replacing the previous
body, status, errpositional return.ip_utils.ip_matches_cidrandip_utils.is_ip_allowednow return
nil, errfor malformed CIDRs, out-of-range masks, or non-IPv4 input,
instead of treating them as an ordinaryfalse.is_ip_allowedfails
closed on the first malformed entry inallowed_ips.ip_utils.get_client_ip(request, trusted_proxies)-- new required
request.remote_addrfield (the real TCP peer address). Forwarding
headers (x-forwarded-for,x-real-ip) are only honored when
trusted_proxiesis given andremote_addrmatches it; the previous
hardcoded127.0.0.1fallback is gone. IPv4 only.
Fixes
json.decode/json.encodeare no longer relied upon to throw --
aligned with the daw-lua-common 2.0.0 contract.socket.http/ltn12requires are now wrapped inpcall.- Case-insensitive header handling in
http_client(no more duplicate
Content-Type/Content-Lengthwhen the caller already supplied a
differently-cased variant).
Internal
init.luarebuilt around themodule_stub()/load_submodule()
facade pattern shared withdaw.common/init.lua.- All public functions consistently return
result, nil | nil, err,
includingtrue, nil/false, nilfor predicate functions. - Test suite: 20 -> 42 tests.
Migration
Callers of
http_clientandip_utilsneed code changes -- see
DAW/steurjan#144 for a worked example. A dedicated migration guide is
planned; until then, DAW/daw-lua-net#6 documents the full change set.Requires daw-lua-common >= 2.0.0.
Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
1 download