]> granicus.if.org Git - pdns/commitdiff
Redirect to the path of the request, not the root
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 2 Dec 2015 10:17:38 +0000 (11:17 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 2 Dec 2015 10:17:38 +0000 (11:17 +0100)
If you proxy at e.g. /auth, redirecting to / 'breaks' the flow.

pdns/ws-auth.cc

index 16df5ec17f2e2a85329ac5219051b10a5e730e10..c30176448ec1efba5131d08c977cd87c3226ded3 100644 (file)
@@ -206,7 +206,7 @@ void AuthWebServer::indexfunction(HttpRequest* req, HttpResponse* resp)
     if (S.ringExists(req->getvars["resetring"]))
       S.resetRing(req->getvars["resetring"]);
     resp->status = 301;
-    resp->headers["Location"] = "/";
+    resp->headers["Location"] = req->url.path;
     return;
   }
   if(!req->getvars["resizering"].empty()){
@@ -214,7 +214,7 @@ void AuthWebServer::indexfunction(HttpRequest* req, HttpResponse* resp)
     if (S.ringExists(req->getvars["resizering"]) && size > 0 && size <= 500000)
       S.resizeRing(req->getvars["resizering"], atoi(req->getvars["size"].c_str()));
     resp->status = 301;
-    resp->headers["Location"] = "/";
+    resp->headers["Location"] = req->url.path;
     return;
   }