1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-05 09:44:26 +00:00

Default MSSQL port 0 to allow automatic detection by default (#11642) (#11673)

Backport #11642

Fix #11633

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath 2020-05-29 14:28:37 +01:00 committed by GitHub
parent 42f0769e30
commit 5911e129a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,7 +163,7 @@ func getPostgreSQLConnectionString(dbHost, dbUser, dbPasswd, dbName, dbParam, db
// ParseMSSQLHostPort splits the host into host and port // ParseMSSQLHostPort splits the host into host and port
func ParseMSSQLHostPort(info string) (string, string) { func ParseMSSQLHostPort(info string) (string, string) {
host, port := "127.0.0.1", "1433" host, port := "127.0.0.1", "0"
if strings.Contains(info, ":") { if strings.Contains(info, ":") {
host = strings.Split(info, ":")[0] host = strings.Split(info, ":")[0]
port = strings.Split(info, ":")[1] port = strings.Split(info, ":")[1]