Mercurial > hg > nginx-tests
comparison js.t @ 1106:4b0b10e39a08
Tests: fixed implicitly declared njs variables after 4337ed48d6d6.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 04 Jan 2017 14:59:18 +0300 |
parents | 4a0e1d7cc20b |
children | edf5a3c9e36a |
comparison
equal
deleted
inserted
replaced
1105:a073a545413d | 1106:4b0b10e39a08 |
---|---|
139 function test_hdr(req, res) { | 139 function test_hdr(req, res) { |
140 return 'hdr=' + req.headers.foo; | 140 return 'hdr=' + req.headers.foo; |
141 } | 141 } |
142 | 142 |
143 function test_ihdr(req, res) { | 143 function test_ihdr(req, res) { |
144 var s; | 144 var s = '', h; |
145 s = ''; | |
146 for (h in req.headers) { | 145 for (h in req.headers) { |
147 if (h.substr(0, 3) == 'foo') { | 146 if (h.substr(0, 3) == 'foo') { |
148 s += req.headers[h]; | 147 s += req.headers[h]; |
149 } | 148 } |
150 } | 149 } |
154 function test_arg(req, res) { | 153 function test_arg(req, res) { |
155 return 'arg=' + req.args.foo; | 154 return 'arg=' + req.args.foo; |
156 } | 155 } |
157 | 156 |
158 function test_iarg(req, res) { | 157 function test_iarg(req, res) { |
159 var s; | 158 var s = '', a; |
160 s = ''; | |
161 for (a in req.args) { | 159 for (a in req.args) { |
162 if (a.substr(0, 3) == 'foo') { | 160 if (a.substr(0, 3) == 'foo') { |
163 s += req.args[a]; | 161 s += req.args[a]; |
164 } | 162 } |
165 } | 163 } |
231 function ihdr(req, res) { | 229 function ihdr(req, res) { |
232 res.status = 200; | 230 res.status = 200; |
233 res.headers['a'] = req.args.a; | 231 res.headers['a'] = req.args.a; |
234 res.headers['b'] = req.args.b; | 232 res.headers['b'] = req.args.b; |
235 | 233 |
236 s = ''; | 234 var s = '', h; |
237 for (h in res.headers) { | 235 for (h in res.headers) { |
238 s += res.headers[h]; | 236 s += res.headers[h]; |
239 } | 237 } |
240 | 238 |
241 res.sendHeader(); | 239 res.sendHeader(); |