File: base64url.t

package info (click to toggle)
libnginx-mod-http-set-misc 0.33-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 408 kB
  • sloc: ansic: 2,205; sh: 106; makefile: 3
file content (40 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# vi:filetype=

use lib 'lib';
use Test::Nginx::Socket;

#repeat_each(3);

plan tests => repeat_each() * 2 * blocks();

no_long_string();

run_tests();

#no_diff();

__DATA__

=== TEST 1: base64url encode
--- config
    location /bar {
        set_encode_base64url $out "?b><d?";
        echo $out;
    }
--- request
    GET /bar
--- response_body
P2I-PGQ_



=== TEST 2: base64url decode
--- config
    location /bar {
        set_decode_base64url $out "P2I-PGQ_";
        echo $out;
    }
--- request
    GET /bar
--- response_body
?b><d?