summaryrefslogtreecommitdiffabout
path: root/tests/atlocal.in
Side-by-side diff
Diffstat (limited to 'tests/atlocal.in') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/atlocal.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/atlocal.in b/tests/atlocal.in
index 18a0b69..14f3fd4 100644
--- a/tests/atlocal.in
+++ b/tests/atlocal.in
@@ -48,16 +48,23 @@ varnish v1 -vcl+backend {
sub vcl_recv {
dbrw.config("$DBRW_TEST_DBTYPE", "$DBRW_TEST_PARAMS",
{"$1"});
set req.http.X-Redirect-To =
dbrw.rewrite("host=" + req.http.Host + ";" +
"url=" + req.url);
- return(synth(301, "Redirect"));
+ if (req.http.X-Redirect-To != "") {
+ return(synth(301, "Redirect"));
+ } else if (req.http.X-VMOD-DBRW-Error == "1") {
+ return(synth(500, "DBRW Error"));
+ }
}
sub vcl_synth {
+ if (req.http.X-VMOD-DBRW-Error == "1") {
+ set resp.http.X-VMOD-DBRW-Error = "1";
+ }
if (resp.status == 301) {
if (req.http.X-VMOD-DBRW-Status) {
set resp.status = std.integer(req.http.X-VMOD-DBRW-Status, 301);
}
set resp.http.Location = req.http.X-Redirect-To;
return (deliver);

Return to:

Send suggestions and report system problems to the System administrator.