summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/farside/router.ex11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/farside/router.ex b/lib/farside/router.ex
index e2014b2..e74f29e 100644
--- a/lib/farside/router.ex
+++ b/lib/farside/router.ex
@@ -28,12 +28,21 @@ defmodule Farside.Router do
path = Enum.join(glob, "/")
instance = Farside.pick_instance(service)
+ params =
+ cond do
+ String.length(conn.query_string) > 0 ->
+ "?#{conn.query_string}"
+
+ true ->
+ ""
+ end
+
# Redirect to the available instance
conn
|> Plug.Conn.resp(:found, "")
|> Plug.Conn.put_resp_header(
"location",
- "#{instance}/#{path}"
+ "#{instance}/#{path}#{params}"
)
end
end