-
Resource leaks on errors - Curl handles aren't always closed if JSON decoding fails or exceptions occur during requests (FIXED: all HTTP functions now properly close handles on all code paths)
-
No error handling on
dkjson.decode()- If GitHub returns malformed JSON (e.g., HTML error page), the code crashes without cleanup (FIXED: added_safeDecode()wrapper using pcall) -
Wrong status code range - Line 138 checks
statusCode >= 200 and statusCode <= 209but should be200-299. This breaks pagination for any 2xx response outside that tiny range. (FIXED: now checks 200-299)
-
No error handling on
curl:perform()- Network failures, timeouts, SSL errors all cause unhandled crashes (FIXED: added_safePerform()wrapper using pcall) -
Brittle Link header parsing - The regex at lines 36-44 can fail on edge cases and doesn't validate
optionsbefore calling:gmatch()on it (FIXED: rewrote parser to validate url/options before use, properly extract rel="value" pairs) -
HTTP/1.1 hardcoded - Line 59 only matches
HTTP/1.1responses; HTTP/2 responses silently fail (FIXED: pattern now matchesHTTP/[0-9.]+)
-
Status code check is
> 399not>= 400- Minor but semantically confusing (FIXED: now uses>= 400) -
No validation of
parseHeaders()output - IfstatusCodeis nil, the comparison crashes (FIXED: now checks if statusCode is nil before comparisons)
-
Rockspec excludes Lua 5.4+ -
"lua >= 5.1, < 5.4"is outdated -
No PATCH method support - Acknowledged in code comments
-
Inconsistent error message formatting