Mercurial > hg > nginx-tests
comparison h2_request_body_js.t @ 1751:18ac4d9e5a2a
Tests: rewriting njs tests without deprecated "js_include".
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Thu, 09 Dec 2021 17:36:29 +0000 |
parents | 5ac6efbe5552 |
children | 386748f328b1 |
comparison
equal
deleted
inserted
replaced
1750:b28f88e352dd | 1751:18ac4d9e5a2a |
---|---|
34 } | 34 } |
35 | 35 |
36 http { | 36 http { |
37 %%TEST_GLOBALS_HTTP%% | 37 %%TEST_GLOBALS_HTTP%% |
38 | 38 |
39 js_include test.js; | 39 js_import test.js; |
40 | 40 |
41 server { | 41 server { |
42 listen 127.0.0.1:8080 http2; | 42 listen 127.0.0.1:8080 http2; |
43 server_name localhost; | 43 server_name localhost; |
44 | 44 |
45 lingering_close off; | 45 lingering_close off; |
46 | 46 |
47 location / { | 47 location / { |
48 js_content sr_body; | 48 js_content test.sr_body; |
49 add_header X-Body $request_body; | 49 add_header X-Body $request_body; |
50 } | 50 } |
51 | 51 |
52 location /sr { } | 52 location /sr { } |
53 } | 53 } |
61 } | 61 } |
62 | 62 |
63 function sr_body(r) { | 63 function sr_body(r) { |
64 r.subrequest('/sr', body_fwd_cb); | 64 r.subrequest('/sr', body_fwd_cb); |
65 } | 65 } |
66 | |
67 export default {sr_body}; | |
66 | 68 |
67 EOF | 69 EOF |
68 | 70 |
69 $t->write_file('sr', 'SEE-THIS'); | 71 $t->write_file('sr', 'SEE-THIS'); |
70 $t->try_run('no njs available')->plan(3); | 72 $t->try_run('no njs available')->plan(3); |