feat: allow prefixes at the beginning of subdomain app hostnames (#10150)

This commit is contained in:
Dean Sheather
2023-10-11 07:02:39 +11:00
committed by GitHub
parent f48bc33e00
commit e7d9b8d858
15 changed files with 306 additions and 6 deletions

View File

@ -42,6 +42,17 @@ func TestApplicationURLString(t *testing.T) {
},
Expected: "8080--agent--workspace--user",
},
{
Name: "Prefix",
URL: httpapi.ApplicationURL{
Prefix: "yolo---",
AppSlugOrPort: "app",
AgentName: "agent",
WorkspaceName: "workspace",
Username: "user",
},
Expected: "yolo---app--agent--workspace--user",
},
}
for _, c := range testCases {
@ -123,6 +134,17 @@ func TestParseSubdomainAppURL(t *testing.T) {
Username: "user-name",
},
},
{
Name: "Prefix",
Subdomain: "dean---was---here---app--agent--workspace--user",
Expected: httpapi.ApplicationURL{
Prefix: "dean---was---here---",
AppSlugOrPort: "app",
AgentName: "agent",
WorkspaceName: "workspace",
Username: "user",
},
},
}
for _, c := range testCases {