Mercurial > hg > nginx-tests
comparison js_request_body.t @ 1614:bc0990ea2e5b
Tests: js TODO adjusted up to 0.4.0.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Tue, 17 Nov 2020 17:49:16 +0000 |
parents | a7902e5adeab |
children | 18ac4d9e5a2a |
comparison
equal
deleted
inserted
replaced
1613:d7ec131d305a | 1614:bc0990ea2e5b |
---|---|
41 | 41 |
42 server { | 42 server { |
43 listen 127.0.0.1:8080; | 43 listen 127.0.0.1:8080; |
44 server_name localhost; | 44 server_name localhost; |
45 | 45 |
46 location /njs { | |
47 js_content test_njs; | |
48 } | |
49 | |
50 location /body { | 46 location /body { |
51 js_content test_body; | 47 js_content test_body; |
52 } | 48 } |
53 | 49 |
54 location /in_file { | 50 location /in_file { |
59 } | 55 } |
60 | 56 |
61 EOF | 57 EOF |
62 | 58 |
63 $t->write_file('test.js', <<EOF); | 59 $t->write_file('test.js', <<EOF); |
64 function test_njs(r) { | |
65 r.return(200, njs.version); | |
66 } | |
67 | |
68 function test_body(r) { | 60 function test_body(r) { |
69 try { | 61 try { |
70 var body = r.requestBody; | 62 var body = r.requestBody; |
71 r.return(200, body); | 63 r.return(200, body); |
72 | 64 |