Skip to content

Commit 000efa7

Browse files
committed
test: allow to set custom http server options
Part of tarantool/security#8
1 parent 977e5e3 commit 000efa7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

http/server.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,7 @@ local exports = {
13281328
internal = {
13291329
response_mt = response_mt,
13301330
request_mt = request_mt,
1331+
extend = extend,
13311332
}
13321333
}
13331334

test/helpers.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ helpers.base_port = 12345
88
helpers.base_host = '127.0.0.1'
99
helpers.base_uri = ('http://%s:%s'):format(helpers.base_host, helpers.base_port)
1010

11-
helpers.cfgserv = function()
11+
helpers.cfgserv = function(opts)
1212
local path = os.getenv('LUA_SOURCE_DIR') or './'
1313
path = fio.pathjoin(path, 'test')
1414

15-
local httpd = http_server.new(helpers.base_host, helpers.base_port, {
15+
local opts = opts or {}
16+
local opts = http_server.internal.extend({
1617
app_dir = path,
1718
log_requests = false,
1819
log_errors = false
19-
})
20+
}, opts)
21+
22+
local httpd = http_server.new(helpers.base_host, helpers.base_port, opts)
2023
:route({path = '/abc/:cde/:def', name = 'test'}, function() end)
2124
:route({path = '/abc'}, function() end)
2225
:route({path = '/ctxaction'}, 'module.controller#action')

0 commit comments

Comments
 (0)