Skip to content

Instantly share code, notes, and snippets.

View 0xae's full-sized avatar
🏠
Working from home

ayrton 0xae

🏠
Working from home
View GitHub Profile
@need12648430
need12648430 / gist:0fb5825c4268b988166e
Created June 21, 2014 08:30
HTTP requests parsed in 4 lines of Lua.
local verb, resource, version, headers, body = data:match("(.+)%s+(.+)%s+(HTTP/%d%.?%d?)\r\n(.-)\r\n\r\n(.-)")
headers:gsub("(.-)%s*:%s*(.-)\r\n", function(name, value)
-- do something with name and value here
end)