Skip to content

Commit 39c3b83

Browse files
committed
Add test for "postgres_rewrite" in "if" pseudo-location.
1 parent 10b55ce commit 39c3b83

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

t/rewrites.t

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,28 @@ Content-Type: application/x-resty-dbd-stream
320320
"bob". # field data
321321
"\x{00}" # row list terminator
322322
--- timeout: 10
323+
324+
325+
326+
=== TEST 15: rows - "if" pseudo-location
327+
--- http_config eval: $::http_config
328+
--- config
329+
location /postgres {
330+
if ($arg_foo) {
331+
postgres_pass database;
332+
postgres_query "select * from cats";
333+
postgres_rewrite no_changes 500;
334+
postgres_rewrite changes 500;
335+
postgres_rewrite no_rows 410;
336+
postgres_rewrite rows 206;
337+
break;
338+
}
339+
340+
return 404;
341+
}
342+
--- request
343+
GET /postgres?foo=1
344+
--- error_code: 206
345+
--- response_headers
346+
Content-Type: application/x-resty-dbd-stream
347+
--- timeout: 10

0 commit comments

Comments
 (0)