Skip to content

Commit

Permalink
PMM-13543 Unescape path to socket.
Browse files Browse the repository at this point in the history
  • Loading branch information
BupycHuk committed Nov 14, 2024
1 parent 9369be0 commit 630307c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions managed/models/agent_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ func (s *Agent) DSN(service *Service, dsnParams DSNParams, tdp *DelimiterPair, p
dsn := u.String()
dsn = strings.ReplaceAll(dsn, url.QueryEscape(tdp.Left), tdp.Left)
dsn = strings.ReplaceAll(dsn, url.QueryEscape(tdp.Right), tdp.Right)
dsn = strings.ReplaceAll(dsn, url.QueryEscape("/"), "/")
return dsn

case PostgresExporterType, QANPostgreSQLPgStatementsAgentType, QANPostgreSQLPgStatMonitorAgentType:
Expand Down
1 change: 1 addition & 0 deletions managed/models/agent_model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func TestAgent(t *testing.T) {
models.ProxySQLExporterType: "username:s3cur3 p@$$w0r4.@unix(/var/run/mysqld/mysqld.sock)/database?timeout=1s",
models.QANMySQLPerfSchemaAgentType: "username:s3cur3 p@$$w0r4.@unix(/var/run/mysqld/mysqld.sock)/database?clientFoundRows=true&parseTime=true&timeout=1s",
models.QANMySQLSlowlogAgentType: "username:s3cur3 p@$$w0r4.@unix(/var/run/mysqld/mysqld.sock)/database?clientFoundRows=true&parseTime=true&timeout=1s",
models.MongoDBExporterType: "mongodb://username:s3cur3%20p%40$$w0r4.@/var/run/mysqld/mysqld.sock/database?connectTimeoutMS=1000&directConnection=true&serverSelectionTimeoutMS=1000",
} {
t.Run(string(typ), func(t *testing.T) {
agent.AgentType = typ
Expand Down

0 comments on commit 630307c

Please sign in to comment.