mirror of
https://github.com/itzg/mc-router.git
synced 2024-11-22 11:35:14 +01:00
Support routing forge clients
This commit is contained in:
parent
5875b0d231
commit
96399cfd40
@ -129,7 +129,7 @@ func (r *routesImpl) FindBackendForServerAddress(serverAddress string) string {
|
|||||||
r.RLock()
|
r.RLock()
|
||||||
defer r.RUnlock()
|
defer r.RUnlock()
|
||||||
|
|
||||||
addressParts := strings.Split(serverAddress, `\x00`)
|
addressParts := strings.Split(serverAddress, "\x00")
|
||||||
|
|
||||||
if r.mappings == nil {
|
if r.mappings == nil {
|
||||||
return r.defaultRoute
|
return r.defaultRoute
|
||||||
|
@ -34,7 +34,7 @@ func Test_routesImpl_FindBackendForServerAddress(t *testing.T) {
|
|||||||
serverAddress: "forge.my.domain", backend: "backend:25566",
|
serverAddress: "forge.my.domain", backend: "backend:25566",
|
||||||
},
|
},
|
||||||
args: args{
|
args: args{
|
||||||
serverAddress: `forge.my.domain\x00FML2\x00`,
|
serverAddress: "forge.my.domain\x00FML2\x00",
|
||||||
},
|
},
|
||||||
want: "backend:25566",
|
want: "backend:25566",
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user