Skip to content

Commit 665bfb2

Browse files
committed
test: test default content-type for render option
Part of tarantool/security#8
1 parent c08227d commit 665bfb2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/integration/http_server_requests_test.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,18 @@ g.test_request_object_methods = function()
365365
t.assert_equals(parsed_body.read_cached, 'hello mister',
366366
'non-json req:read_cached()')
367367
end
368+
369+
g.test_content_type_header_with_render = function()
370+
local httpd = g.httpd
371+
httpd:route({
372+
method = 'GET',
373+
path = '/content_type',
374+
file = 'helper.html.el'
375+
}, function(tx)
376+
return tx:render()
377+
end)
378+
379+
local r = http_client.get(helpers.base_uri .. '/content_type')
380+
t.assert_equals(r.status, 200)
381+
t.assert_equals(r.headers['content-type'], 'text/html; charset=utf-8', 'content-type header')
382+
end

0 commit comments

Comments
 (0)