Skip to content

Commit

Permalink
add test for reverse proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
htfy96 committed Jun 15, 2020
1 parent 3daafa3 commit 7becc3c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/Caddyfile.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
debug
order filter first
}
http://localhost:2015 {
reverse_proxy {
to https://raw.githubusercontent.com
header_up Host "raw.githubusercontent.com"
}
filter {
content_type .*
search_pattern "foo"
replacement "bar"
}
}
7 changes: 7 additions & 0 deletions test/run-test
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ diff output3_1 test/test-3-1.ref
curl -v http://localhost:2015/test > output3_2
diff output3_2 test/test-3-2.ref
cleanup

$XCADDY run -config test/Caddyfile.4&
pid="$!"
sleep 7
curl -v http://localhost:2015/sjtug/caddy2-filter/master/test/test-4.input > output4
diff output4 test/test-4.ref
cleanup
1 change: 1 addition & 0 deletions test/test-4.input
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo
1 change: 1 addition & 0 deletions test/test-4.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bar

0 comments on commit 7becc3c

Please sign in to comment.