Skip to content
Snippets Groups Projects
Commit f39177f6 authored by Francesco Gramegna's avatar Francesco Gramegna
Browse files

ShareUrl: 127.0.0.1 now treated as localhost

Now treating 127.0.0.1 the same as localhost in the dynamic shareUrl creation (since some people would still connect in this way).
parent 130b5625
No related branches found
No related tags found
1 merge request!36Fixes cs214/ul2024/webapp-lib#1: ShareUrl: Dynamically created by client
......@@ -275,7 +275,7 @@ case class AppPage(appId: AppId, uiId: UIId, instanceId: InstanceId, userId: Use
.replace("{{hostName}}", hostName + (if port.nonEmpty then f":$port" else ""))
.replace("{{userId}}", URLEncoder.encode(userId, "UTF-8"))
val shareUrlHost =
if hostName == "localhost" then appInfo.hostAddress else hostName
if (hostName == "localhost" || hostname == "127.0.0.1") then appInfo.hostAddress else hostName
val shareUrl = f"$hypertextProtocol://${shareUrlHost}${if port.nonEmpty then f":$port" else ""}${appInfo.shareSubUrl}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment