# This file is part of pound testsuite. -*- autotest -*- # Copyright (C) 2026 Sergey Poznyakoff # # Pound is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Pound is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with pound. If not, see . AT_SETUP([Access to constants]) AT_KEYWORDS([lua lua-mod lua-const]) AT_SKIP_IF([test "$LUA_AVAILABLE" != 1]) AT_DATA([mod.lua], [[function x_const() http.resp.headers = { ['X-Const'] = http:const("a") } end ]]) PT_CHECK([Lua Load "mod.lua" End ListenHTTP Constant "a" "some text" Rewrite response LuaModify "x_const" End Service Backend End End End ], [GET /echo/file end 200 X-Const: some text end ]) AT_CLEANUP