mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-19 08:07:58 +02:00
Tests: use separate controller listening ports to prevent conflicts (#58)
This commit is contained in:
@@ -161,8 +161,11 @@ func (controller *Controller) Run(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (controller *Controller) Address() string {
|
||||
if strings.HasPrefix(controller.listenAddr, ":") {
|
||||
return fmt.Sprintf("http://localhost%s", controller.listenAddr)
|
||||
hostPort := strings.ReplaceAll(controller.listener.Addr().String(), "[::]", "127.0.0.1")
|
||||
|
||||
if controller.tlsConfig != nil {
|
||||
return fmt.Sprintf("https://%s", hostPort)
|
||||
}
|
||||
return controller.listenAddr
|
||||
|
||||
return fmt.Sprintf("http://%s", hostPort)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user