mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 06:42:21 +08:00
fix: postgresql ipv6 host should not be enclosed in square brackets (#47522)
This commit is contained in:
@ -140,7 +140,7 @@ func (s *Service) generateConnectionString(dsInfo sqleng.DataSourceInfo) (string
|
||||
}
|
||||
} else {
|
||||
if index == v6Index+1 {
|
||||
host = dsInfo.URL[0:index]
|
||||
host = dsInfo.URL[1 : index-1]
|
||||
var err error
|
||||
port, err = strconv.Atoi(dsInfo.URL[index+1:])
|
||||
if err != nil {
|
||||
@ -149,7 +149,7 @@ func (s *Service) generateConnectionString(dsInfo sqleng.DataSourceInfo) (string
|
||||
|
||||
logger.Debug("Generating ipv6 connection string with network host/port pair", "host", host, "port", port)
|
||||
} else {
|
||||
host = dsInfo.URL
|
||||
host = dsInfo.URL[1 : len(dsInfo.URL)-1]
|
||||
logger.Debug("Generating ipv6 connection string with network host", "host", host)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user