~ubuntu-branches/ubuntu/quantal/nginx/quantal-updates

« back to all changes in this revision

Viewing changes to debian/modules/nginx-lua/t/022-redirect.t

  • Committer: Bazaar Package Importer
  • Author(s): Michael Lustfield, Micheal Lustfield, Kartik Mistry
  • Date: 2011-03-03 23:39:07 UTC
  • mfrom: (4.2.29 sid)
  • Revision ID: james.westby@ubuntu.com-20110303233907-y48yifhfnn5qjuxz
Tags: 0.8.54-4
[Micheal Lustfield]
* debian/nginx-{full,light,extras}.default:
  + Added comment about alternative to ULIMIT.
* debian/nginx-{full,light,extras}.init.d:
  + Added quotes around a test variable. (Closes: #610946, LP: #699736)
* debian/patches/609343-log-time-iso8601.diff:
  + Added patch to add $time_iso8601 variable to logs. (Closes: #609343)
* Clean up old logrotate files. (Closes: #608983, Closes: #610289)
  + Added Files:
    - debian/nginx-common.preinst
  + Modified Files:
    - debian/rules
  + Moved debian/nginx-common.logrotate to debian/logrotate.
* Added common files to nginx-common package. (Closes: #610290)
  + Removed Files:
    - debian/nginx-full.dirs
    - debian/nginx-light.dirs
    - debian/nginx-full.install
    - debian/nginx-light.install
    - debian/nginx-extras.install
    - debian/nginx.*
  + Added Files:
    - debian/nginx-common.default
    - debian/nginx-common.dirs
    - debian/nginx-common.init.d
    - debian/nginx-common.install
    - debian/nginx-common.manpages
    - debian/logrotate
  + Modified Files:
    - debian/nginx-extras.dirs
    - debian/control
    - debian/rules
* debian/nginx-*.install: (Closes: #609797)
  + Removed NEWS.Debian from nginx-{full,light,extras}.install.
  + Added NEWS.Debian to nginx-common.install.
* nginx-common.postinst:
  + Enforce /var/log/nginx mode and user:group. (Closes: #610983)
  + Enforce /var/log/nginx/*.log mode and user:group. (Closes: #612832)
* debian/rules:
  + Added --with-file-aio to nginx-extras. (Closes: #613175)
  + Removed split clients and user id modules from nginx-light.
* debian/conf/sites-available/default:
  + Fixed a minor typo ( s/Quickstart/QuickStart/ ). (Closes: #613355)
* debian/conf/mime.types:
  + Changed xml type to application/xhtml+xml. (Closes: #613851)
* debian/help/docs/fcgiwrap:
  + Removed Ubuntu specific line in docs. (Closes: #614987)
* debian/conf/sites-available/default:
  + Fixed a pointer to a file. (Closes: #614980)

[Kartik Mistry]
* debian/*.lintian-overrides:
  + Add Lintian overrides for nginx man page. We've manpage in nginx-common
    binary

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim:set ft= ts=4 sw=4 et fdm=marker:
 
2
 
 
3
use lib 'lib';
 
4
use Test::Nginx::Socket;
 
5
 
 
6
#worker_connections(1014);
 
7
#master_process_enabled(1);
 
8
#log_level('warn');
 
9
 
 
10
repeat_each(2);
 
11
#repeat_each(1);
 
12
 
 
13
plan tests => blocks() * repeat_each() * 3;
 
14
 
 
15
#no_diff();
 
16
#no_long_string();
 
17
 
 
18
$ENV{TEST_NGINX_PORT} ||= 1984;
 
19
 
 
20
run_tests();
 
21
 
 
22
__DATA__
 
23
 
 
24
=== TEST 1: default 302
 
25
--- config
 
26
    location /read {
 
27
        content_by_lua '
 
28
            ngx.redirect("http://www.taobao.com/foo");
 
29
            ngx.say("hi")
 
30
        ';
 
31
    }
 
32
--- request
 
33
GET /read
 
34
--- response_headers
 
35
Location: http://www.taobao.com/foo
 
36
--- response_body_like: 302 Found
 
37
--- error_code: 302
 
38
 
 
39
 
 
40
 
 
41
=== TEST 2: explicit 302
 
42
--- config
 
43
    location /read {
 
44
        content_by_lua '
 
45
            ngx.redirect("http://www.taobao.com/foo", ngx.HTTP_MOVED_TEMPORARILY);
 
46
            ngx.say("hi")
 
47
        ';
 
48
    }
 
49
--- request
 
50
GET /read
 
51
--- response_headers
 
52
Location: http://www.taobao.com/foo
 
53
--- response_body_like: 302 Found
 
54
--- error_code: 302
 
55
 
 
56
 
 
57
 
 
58
=== TEST 3: explicit 301
 
59
--- config
 
60
    location /read {
 
61
        content_by_lua '
 
62
            ngx.redirect("http://www.taobao.com/foo", ngx.HTTP_MOVED_PERMANENTLY);
 
63
            ngx.say("hi")
 
64
        ';
 
65
    }
 
66
--- request
 
67
GET /read
 
68
--- response_headers
 
69
Location: http://www.taobao.com/foo
 
70
--- response_body_like: 301 Moved Permanently
 
71
--- error_code: 301
 
72
 
 
73
 
 
74
 
 
75
=== TEST 4: bad rc
 
76
--- config
 
77
    location /read {
 
78
        content_by_lua '
 
79
            ngx.redirect("http://www.taobao.com/foo", 404);
 
80
            ngx.say("hi")
 
81
        ';
 
82
    }
 
83
--- request
 
84
GET /read
 
85
--- response_headers
 
86
!Location
 
87
--- response_body_like: 500 Internal Server Error
 
88
--- error_code: 500
 
89
 
 
90
 
 
91
 
 
92
=== TEST 5: no args
 
93
--- config
 
94
    location /read {
 
95
        content_by_lua '
 
96
            ngx.redirect()
 
97
            ngx.say("hi")
 
98
        ';
 
99
    }
 
100
--- request
 
101
GET /read
 
102
--- response_headers
 
103
!Location
 
104
--- response_body_like: 500 Internal Server Error
 
105
--- error_code: 500
 
106
 
 
107
 
 
108
 
 
109
=== TEST 6: relative uri
 
110
--- config
 
111
    location /read {
 
112
        content_by_lua '
 
113
            ngx.redirect("/foo")
 
114
            ngx.say("hi")
 
115
        ';
 
116
    }
 
117
--- request
 
118
GET /read
 
119
--- raw_response_headers_like: Location: http://localhost(?::\d+)?/foo\r\n
 
120
--- response_body_like: 302 Found
 
121
--- error_code: 302
 
122