Skip to content

Commit 1609240

Browse files
fix: remove profile subdomain alert side channel
1 parent 3fc9c87 commit 1609240

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

lib/algora_web/endpoint.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ defmodule AlgoraWeb.Endpoint do
124124
conn.request_path
125125

126126
_user ->
127-
Algora.Activities.alert("👀 Someone is viewing https://#{sub}.algora.io", :critical)
128127
Path.join(["/#{sub}/candidates", conn.request_path])
129128
end
130129
end
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
defmodule AlgoraWeb.EndpointSubdomainTest do
2+
use AlgoraWeb.ConnCase, async: true
3+
4+
import Algora.Factory
5+
6+
test "known profile subdomains redirect without creating a critical activity", %{conn: conn} do
7+
insert!(:user, handle: "acme")
8+
9+
conn =
10+
conn
11+
|> Map.put(:host, "acme.algora.io")
12+
|> get("/jobs")
13+
14+
assert redirected_to(conn, 301) == "http://localhost/acme/candidates/jobs"
15+
assert_activity_names([])
16+
end
17+
end

0 commit comments

Comments
 (0)