   end
 
   @doc """
-  Returns the current request path, with and without query params.
-
-  By default, the connection's query params are included in
-  the generated path. Custom query params may be used instead
-  by providing a map of your own params. You may also retrieve
-  only the request path by passing an empty map of params.
-
-  ## Examples
+  Returns the current request path with its default query parameters:
 
       iex> current_path(conn)
       "/users/123?existing=param"
 
+  See `current_path/2` to override the default parameters.
+  """
+  def current_path(%Plug.Conn{query_string: ""} = conn) do
+    conn.request_path
+  end
+
+  def current_path(%Plug.Conn{query_string: query_string} = conn) do
+    conn.request_path <> "?" <> query_string
+  end
+
+  @doc """
+  Returns the current path with the given query parameters.
+
+  You may also retrieve only the request path by passing an
+  empty map of params.
+
+  ## Examples
+
+      iex> current_path(conn)
+      "/users/123?existing=param"
+
       iex> current_path(conn, %{new: "param"})
       "/users/123?new=param"
 

  end

  @doc """
  Puts the URL or `%URI{}` to be used for route generation.

  This function overrides the default URL generation pulled
  from the `%Plug.Conn{}`'s endpoint configuration.

      "/users/123"

  """
  def current_path(%Plug.Conn{} = conn, params) when params == %{} do
    conn.request_path
  end
