Skip to content

Commit

Permalink
provider: use sqlclient.ParseURL to avoid leaking invalid URL (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm authored Dec 2, 2024
1 parent 6f49f62 commit e6cd468
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/provider/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"strings"

"ariga.io/atlas/sql/migrate"
"ariga.io/atlas/sql/sqlclient"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hclsyntax"
"github.com/hashicorp/hcl/v2/hclwrite"
Expand Down Expand Up @@ -336,7 +337,7 @@ func absoluteSqliteURL(s string) (string, error) {
// No URL to parse.
return "", nil
}
switch u, err := url.Parse(filepath.ToSlash(s)); {
switch u, err := sqlclient.ParseURL(filepath.ToSlash(s)); {
case err != nil:
return "", err
case SchemaTypeSQLite != u.Scheme:
Expand Down

0 comments on commit e6cd468

Please sign in to comment.