aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add SSE sink (socket.sse module)feat/sseThijs Schreijer2 days9-13/+827
| | | | | | | Implements SSE by using the replacement body sink. Replaces the sink with an SSE parser if the response is a text stream. Example application included
* Add CI-runnable HTTP test fixture on the testsrvr/testclnt harnessThijs Schreijer2 days3-0/+174
| | | | | | | | | | | | Drives socket.http.request against fully scripted, controlled raw HTTP responses over a real socket by reusing the existing testsrvr.lua remote-execution server -- no Apache, no Docker, no third-party hosts. Proves the fixture with a plain-GET smoke test, a chunked-transfer- encoding smoke test, and a test asserting a response body delivered across separately-timed writes (the incremental-delivery capability the upcoming SSE tests need). Wires the new test into the CI regression step. Claude-Session: https://claude.ai/code/session_01SW789SftppghLPVXYbWsGi
* Address PR review: pass raw socket to headers callback, use ok/err return ↵http-headers-callbackThijs Schreijer2 days2-8/+38
| | | | | | | | | | | | | convention Rename response_headers to headers_callback, pass the raw connection as a 4th argument (for use cases like WebSocket upgrade handoff), and switch its return contract to the idiomatic ok/err shape used elsewhere in this file: truthy ok continues (optionally swapping in a new sink), falsy ok closes the connection and propagates the callback's error via socket.protect instead of faking a success return. Claude-Session: https://claude.ai/code/session_01S4imKCU4hxDg96DXj9hxSB
* Add HTTP response headers callback to allow for early abort or different ↵Frans de Jonge3 days1-0/+12
| | | | sink depending on response
* Add Lua 5.5 support (#473)Caleb Maclennan3 days5-5/+12
|
* chore(docs): Backfill changelog entries for merged PRs and assorted commitsCaleb Maclennan3 days1-0/+17
|
* feat(core): Handle response code 308 permanent redirectAmanda Stjerna3 days1-1/+1
|
* Merge pull request #472 from lunarmodules/feat/url-hosttypeCaleb Maclennan3 days4-7/+327
|\ | | | | feat(url): classify host as name/ipv4/ipv6 in parse and build
| * fix(http): bracket IPv6 host in Host headerThijs Schreijer4 days1-1/+2
| | | | | | | | | | | | | | | | | | The Host header must wrap an IPv6 literal in brackets (RFC 7230), but adjustheaders() used reqt.host as-is, which is unbracketed after url.parse(). Use url.classify_host() to detect IPv6 and bracket it, handling an already-bracketed input without doubling the brackets. Closes #445
| * feat(url): classify host as name/ipv4/ipv6 in parse and buildThijs Schreijer4 days3-6/+325
| | | | | | | | | | | | | | | | | | | | parse() now sets hosttype ("name"/"ipv4"/"ipv6") plus a matching hostname/ipv4/ipv6 field alongside host. build() accepts those same fields when host is absent, erroring if more than one is set. classify_host is exported for standalone use; it classifies by shape (colon present -> ipv6, dotted-quad shape -> ipv4) rather than validating the address.
* | Merge pull request #467 from lunarmodules/fix/http-size-protectCaleb Maclennan3 days5-8/+238
|\ \ | | | | | | Fix/http size protect
| * | feat(http/ftp/smtp): implement max size checksThijs Schreijer5 days5-8/+238
| | | | | | | | | | | | | | | fixes unbounded reads when using the "*l" pattern. Typically on headers and other control lines.
| * | refactor(receive): make implicit line reads explicitThijs Schreijer5 days2-7/+7
| | |
* | | Merge pull request #470 from lunarmodules/header-canonCaleb Maclennan3 days4-97/+209
|\ \ \ | | | | | | | | feat(headers): dynamically create cononicalized headers
| * | | Apply code review suggestionsThijs Schreijer5 days2-1/+4
| | | | | | | | | | | | Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| * | | feat(headers): dynamically create cononicalized headersThijs Schreijer5 days4-97/+206
| | |/ | |/| | | | | | | | | | | | | | | | | | | Instead of a static list dynamically add entries in proper casing. Also allowing to add non-standard ones through `setcanonic`. closes #442 fixes #440
* | | Merge pull request #471 from lunarmodules/fix/zero-readCaleb Maclennan3 days8-10/+542
|\ \ \ | | | | | | | | fix(receive): a receive 0 should immediately return, not block
| * | | fix(udp): receive(0) tests and bad call to getnameinfoThijs Schreijer4 days6-1/+490
| | | |
| * | | fix(receive): a receive 0 should immediately return, not blockThijs Schreijer4 days5-10/+53
| | |/ | |/| | | | | | | | | | | | | | | | | | | The fix is slightly more complex because reading from a closed socket should still return a closed-error. fixes: #427 fixes: https://github.com/ledgetech/lua-resty-http/pull/313
* | | Merge pull request #463 from lunarmodules/feat/receive-limitCaleb Maclennan3 days5-30/+356
|\ \ \ | | | | | | | | feat(receive): add maxsize argument to bound memory usage
| * | | chore(test): add 2 tests reusing partial resultsThijs Schreijer3 days1-3/+20
| |/ / | | | | | | | | | | | | Tests to show the socket isn't left in an undetermined state due to dataloss, since the partial results are returned to the user.
| * | fix(receive): guard numeric pattern against size_t overflow on castThijs Schreijer5 days2-3/+6
| | | | | | | | | | | | | | | | | | Same class of bug as the maxsize cast: a double larger than SIZE_MAX cast to size_t is undefined behavior. Bound-check the numeric receive pattern before the cast, and cover it with a test.
| * | fix(receive): guard maxsize against size_t overflow on castThijs Schreijer5 days2-3/+6
| | | | | | | | | | | | | | | Casting a double larger than SIZE_MAX to size_t is undefined behavior; bound-check maxsize before the cast.
| * | chore(docs): some cleanupThijs Schreijer2026-08-171-46/+6
| | |
| * | feat(receive): add maxsize argument to bound memory usageThijs Schreijer2026-07-305-23/+366
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | client:receive("*l") and receive("*a") are unbounded: a peer that never sends a newline, or never closes, makes LuaSocket buffer until the process runs out of memory (e.g. src/http.lua reading response headers in a loop). Add an optional maxsize argument that caps the payload a single call may accumulate, including prefix. - Hoist all argument validation ahead of timeout_markstart() so bad calls (maxsize < 1, #prefix >= maxsize, numeric pattern > maxsize) raise before any I/O and leave the socket untouched. - recvline/recvall take a budget and return a new internal BUF_OVERSIZED code, surfaced to Lua as the "oversized" error alongside "timeout"/"closed", with the partial held in the 3rd return value. - recvraw is left untouched: argument checks make the cap unreachable for numeric patterns. - Preserve three invariants: a timeout partial is always shorter than maxsize (safe to retry as prefix), completion beats the cap for *a, and no bytes are lost or skipped on overflow. - tcp.c, unixstream.c and serial.c all share this code path unchanged. Adds test coverage (argument errors, *l/*a boundaries, timeout/close at the cap, the drain idiom, numeric patterns, unix-stream mirror) and documents the new argument, error, and recovery idioms in docs/tcp.html.
* | | Merge pull request #449 from Wires77/add_SO_EXCLUSIVEADDRUSECaleb Maclennan3 days6-5/+108
|\ \ \ | |_|/ |/| | Add option for SO_EXCLUSIVEADDRUSE in Windows
| * | chore(docs): add docs for SO_EXCLUSIVEADDRUSE and othersThijs Schreijer3 days2-5/+71
| | | | | | | | | | | | | | | Adds docs for the option, but also adds the docs for other options present in the code but missing from the docs.
| * | feat(core): Add option for Windows SO_EXCLUSIVEADDRUSEWires773 days4-0/+37
| |/
* | chore(deps): bump luarocks/gh-actions-lua in the github-actions group (#468)dependabot[bot]2026-08-131-1/+1
| |
* | chore(deps): bump the github-actions group with 2 updates (#465)dependabot[bot]2026-07-302-3/+3
| | | | | | Signed-off-by: dependabot[bot] <support@github.com>
* | chore: add Dependabot config and pin GitHub Actions to git SHAs (#464)Copilot2026-07-304-9/+24
|/
* feat(udp): Allow changing UDP_DATAGRAMSIZE at compile time (#452)Victor Bombi2025-11-141-0/+2
|
* ci: Switch back to luarocks instance of GH actionCaleb Maclennan2025-05-301-1/+2
|
* feat: Add ucrt64 support in makefile (#455)Raffaello Bertini2025-05-292-2/+27
|
* ci: Fix the build for LuaJIT and OpenResty on Windows (#453)Luau2025-05-291-1/+2
|
* docs: Improve installation instructions, focus on LuaRocks installation (#454)Sharad Singh2025-03-311-55/+15
|
* Merge pull request #450 from luau-project/update-ciCaleb Maclennan2025-03-011-3/+3
|\ | | | | Update CI
| * fix: Use a macos version supported by GitHub Actionsluau-project2025-03-011-1/+1
| |
| * ci: Use GitHub Actions from luarocks namespaceluau-project2025-03-011-2/+2
|/
* Merge pull request #447 from masakk1/patch-1Caleb Maclennan2025-02-231-2/+2
|\
| * docs: Remove unnecessary `value` argument from gettimeoutMasak12025-02-231-2/+2
| |
| * docs: Fix udp documentation gettimeout typoMasak12025-02-231-2/+2
|/
* chore: Remove the executable permission bit from some source files (#434)Tianjia Zhang2024-06-2915-0/+0
|
* fix(unix): Pass correct path length for abstract sockets (#430)Kim Alvefur2024-05-242-41/+42
|
* chore(docs): update LTN12 links (#428)Thijs Schreijer2024-03-155-20/+20
|
* fix(docs): link to included LTN documents (#426)Thijs Schreijer2024-03-052-1/+10
|
* chore(http): Correct typos in error message and code comments (#423)Alexandre Detiste2024-02-123-6/+6
|
* fix(http): Use the right protocol for proxies (#386)Max1Truc2023-11-231-3/+8
|
* fix(http): Correct receiveheaders() handling of folded values (#420)_AMD_2023-11-131-1/+1
|
* style(docs): Trim trailing whitespace in HTML docsCaleb Maclennan2023-11-113-82/+82
| | | | | | Many editors remove these automatically anyway which makes opening and editng the docs cause a bunch of noise. This is just to get the noise out of the way in a style commit so it doesn't leak into other PRs