mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-26 12:26:05 -05:00
Fix Domain() to return BaseDomain instead of ServerURL hostname
Co-authored-by: kradalby <98431+kradalby@users.noreply.github.com>
This commit is contained in:
@@ -57,10 +57,10 @@ func TestMapResponseBuilder_WithCapabilityVersion(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMapResponseBuilder_WithDomain(t *testing.T) {
|
||||
domain := "test.example.com"
|
||||
baseDomain := "internal.example.com"
|
||||
cfg := &types.Config{
|
||||
ServerURL: "https://test.example.com",
|
||||
BaseDomain: domain,
|
||||
ServerURL: "https://headscale.external.com",
|
||||
BaseDomain: baseDomain,
|
||||
}
|
||||
|
||||
mockState := &state.State{}
|
||||
@@ -74,7 +74,8 @@ func TestMapResponseBuilder_WithDomain(t *testing.T) {
|
||||
builder := m.NewMapResponseBuilder(nodeID).
|
||||
WithDomain()
|
||||
|
||||
assert.Equal(t, domain, builder.resp.Domain)
|
||||
// Domain should be the BaseDomain (internal tailnet domain), not ServerURL hostname
|
||||
assert.Equal(t, baseDomain, builder.resp.Domain)
|
||||
assert.False(t, builder.hasErrors())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user