Tim Duesterhus | 84ebc13 | 2020-05-19 13:49:41 +0200 | [diff] [blame^] | 1 | varnishtest "Lua: set_var" |
| 2 | #REQUIRE_OPTIONS=LUA |
| 3 | |
| 4 | feature ignore_unknown_macro |
| 5 | |
| 6 | haproxy h1 -conf { |
| 7 | global |
| 8 | lua-load ${testdir}/set_var.lua |
| 9 | |
| 10 | frontend fe1 |
| 11 | mode http |
| 12 | ${no-htx} option http-use-htx |
| 13 | bind "fd@${fe1}" |
| 14 | |
| 15 | http-request use-service lua.set_var |
| 16 | } -start |
| 17 | |
| 18 | client c0 -connect ${h1_fe1_sock} { |
| 19 | txreq -url "/" \ |
| 20 | -hdr "Var: txn.foo" |
| 21 | rxresp |
| 22 | expect resp.status == 202 |
| 23 | expect resp.http.echo == "value" |
| 24 | txreq -url "/" \ |
| 25 | -hdr "Var: invalid.var" |
| 26 | rxresp |
| 27 | expect resp.status == 400 |
| 28 | expect resp.http.echo == "(nil)" |
| 29 | } -run |