Mercurial > hg > nginx-site
comparison xml/en/docs/njs/examples.xml @ 2643:4849fa0fd4b4
Removed URL Decoding/Encoding examples from njs.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Mon, 25 Jan 2021 19:13:09 +0000 |
parents | c60bcc0de435 |
children | 9cafae0b7ef3 |
comparison
equal
deleted
inserted
replaced
2642:c60bcc0de435 | 2643:4849fa0fd4b4 |
---|---|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> | 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
8 | 8 |
9 <article name="Examples" | 9 <article name="Examples" |
10 link="/en/docs/njs/examples.html" | 10 link="/en/docs/njs/examples.html" |
11 lang="en" | 11 lang="en" |
12 rev="17"> | 12 rev="18"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 The examples work since | 17 The examples work since |
424 </note> | 424 </note> |
425 </para> | 425 </para> |
426 | 426 |
427 </section> | 427 </section> |
428 | 428 |
429 <section id="urldecode" name="URL Decoding"> | |
430 | |
431 <para> | |
432 <path>nginx.conf</path>: | |
433 <example> | |
434 js_import http.js; | |
435 | |
436 js_set $decoded_foo http.decoded_foo; | |
437 </example> | |
438 </para> | |
439 | |
440 <para> | |
441 <path>http.js</path>: | |
442 <example> | |
443 function decoded_foo(r) { | |
444 return decodeURIComponent(r.args.foo); | |
445 } | |
446 | |
447 export default {decoded_foo}; | |
448 </example> | |
449 </para> | |
450 | |
451 </section> | |
452 | |
453 | |
454 <section id="urlencode" name="URL Encoding"> | |
455 | |
456 <para> | |
457 <path>nginx.conf</path>: | |
458 <example> | |
459 js_import http.js; | |
460 | |
461 js_set $encoded_foo http.encoded_foo; | |
462 ... | |
463 | |
464 location / { | |
465 proxy_pass http://example.com?foo=$encoded_foo; | |
466 } | |
467 </example> | |
468 </para> | |
469 | |
470 <para> | |
471 <path>http.js</path>: | |
472 <example> | |
473 function encoded_foo(r) { | |
474 return encodeURIComponent('foo & bar?'); | |
475 } | |
476 | |
477 export default {encoded_foo}; | |
478 </example> | |
479 </para> | |
480 | |
481 </section> | |
482 | |
483 </section> | 429 </section> |
484 | 430 |
485 </article> | 431 </article> |