Skip to content

Commit e23b003

Browse files
florishwhatyouhide
authored andcommitted
Use Plug.Conn.request_url/1 to reconstruct URL (#115)
This ensures that query strings and port numbers are correctly added to the URL, which wasn't the case in the previous implementation.
1 parent a85c0cb commit e23b003

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pages/Using Rollbax in Plug-based applications.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ defp handle_errors(conn, %{kind: kind, reason: reason, stack: stacktrace}) do
3939
occurrence_data = %{
4040
"request" => %{
4141
"cookies" => conn.req_cookies,
42-
"url" => "#{conn.scheme}://#{conn.host}:#{conn.port}#{conn.request_path}",
42+
"url" => Plug.Conn.request_url(conn),
4343
"user_ip" => List.to_string(:inet.ntoa(conn.remote_ip)),
4444
"headers" => Enum.into(conn.req_headers, %{}),
4545
"method" => conn.method,

0 commit comments

Comments
 (0)