Skip to content

Commit

Permalink
Fix HTTP test
Browse files Browse the repository at this point in the history
  • Loading branch information
javalikescript committed Jan 27, 2024
1 parent 80b46b0 commit 029ff5a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions tests/full/http.lua
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,25 @@ local function createLongBody()
]]
end

function Test_HttpClient_no_header()
function TODO_Test_HttpClient_no_header()
local server = createTcpServer(function(server, client, data)
client:write(createHttpRawResponse('', 200, '', 'OK', '1.0'))
client:close()
end)
local client = createHttpClient()
sendReceiveClose(client)
if not loop(function()
client:close()
server:close()
end) then
lu.fail('Timeout reached')
end
lu.assertNotIsNil(client.t_err)
end

function Test_HttpClient_no_header_1_1()
-- no headers (no connection close) means unknown body size so we expect an error
local server = createTcpServer(createHttpRawResponse())
local server = createTcpServer(createHttpRawResponse('', 200, '', 'OK', '1.1'))
local client = createHttpClient()
sendReceiveClose(client)
if not loop(function()
Expand Down

0 comments on commit 029ff5a

Please sign in to comment.