Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add headers if not set #65

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d48ca6a
add objs/* and autoconf to gitignore
detailyang Aug 14, 2016
4b5f079
add -i option (if not set) to more_set_input_headers
detailyang Aug 14, 2016
8344531
add -i option (if not set) to more_set_headers
detailyang Aug 14, 2016
3b64ac7
allow if no set on non builtin header on more_set_headers
detailyang Aug 15, 2016
6d45d4f
add test for -i option
detailyang Aug 15, 2016
5c73081
better prompt when skip with -i option
detailyang Aug 15, 2016
c802c27
add -i option description to README
detailyang Aug 15, 2016
48c4d43
if no set should work on multi header
detailyang Aug 16, 2016
12c3a00
work together on -r replace and -i if not set
detailyang Aug 17, 2016
30daad1
add test for -i (if not set) option
detailyang Aug 17, 2016
9c53270
Fix: do not set header when header already set
detailyang Aug 17, 2016
ec1fad6
add test for -r -t -i
detailyang Aug 17, 2016
ac52358
add test for more_set_headers on -i -t work together
detailyang Aug 17, 2016
b073439
Merge branch 'master' of https://github.com/detailyang/headers-more-n…
detailyang Aug 17, 2016
e9fbadf
remove misc in gitignore because of we are using the standard building
detailyang Aug 18, 2016
e4202d1
reindex t/*.t
detailyang Aug 18, 2016
0a6073d
correct code style
detailyang Aug 18, 2016
fe4f575
typo: grammer fix
detailyang Aug 18, 2016
0c93a4c
add new line in gitignore
detailyang Aug 18, 2016
c987b90
remove Makefile new line in gitignore
detailyang Aug 18, 2016
df0e156
trailing line space
detailyang Aug 18, 2016
5a0a562
typo -i to -a at t/sanity.t
detailyang Aug 18, 2016
cdfc604
boolean equal shoule use ! rather than 0
detailyang Aug 18, 2016
15ae885
Ditto, Boolean field test should use the !a instead of the a == 0
detailyang Aug 18, 2016
34c5f33
typo: doesnt => do not
detailyang Aug 18, 2016
bb8a365
typo it do not => it does not
detailyang Aug 18, 2016
964d53c
typo remove new values on README.markdown
detailyang Aug 18, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test for more_set_headers on -i -t work together
detailyang committed Aug 17, 2016
commit ac523588b1fef6623e42f5bf4c2e7f4c444ad995
26 changes: 25 additions & 1 deletion t/sanity.t
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ use Test::Nginx::Socket;

repeat_each(2);

plan tests => repeat_each() * 119;
plan tests => repeat_each() * 124;

#master_on();
#workers(2);
@@ -599,3 +599,27 @@ X-Foo: baz
--- response_body
hi


=== TEST 36: test -t -i work together
--- config
location = /backend {
add_header Content-Type text/html;
echo hi;
}

location /foo {
more_set_headers -t 'text/plain' -i 'X-Foo: bar';
proxy_pass http://127.0.0.1:$server_port/backend;
}

location /bar {
more_set_headers -t 'text/html' -i 'X-Foo: bar';
proxy_pass http://127.0.0.1:$server_port/backend;
}

--- request eval
["GET /foo", "GET /bar"]
--- response_headers eval
["", "X-Foo: bar"]
--- response_body eval
["hi\n", "hi\n"]