Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #60 from prashantkhandelwal/dbpasswd
Browse files Browse the repository at this point in the history
Issue#56 - Escape special characters in MongoDB password.
  • Loading branch information
paraswaykole committed Jan 13, 2023
2 parents 071eb53 + 75c94ba commit 33b5d38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/models/dbconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package models

import (
"errors"
"net/url"
"time"

"github.com/google/uuid"
Expand Down Expand Up @@ -46,6 +47,9 @@ func NewDBConnection(projectID string, name string, dbtype string, dbscheme, dbh
if !utils.ContainsString([]string{"mongodb", "mongodb+srv"}, dbscheme) {
return nil, errors.New("invalid dbscheme")
}

dbpassword = url.QueryEscape(dbpassword)

} else {
return nil, errors.New("dbtype is not correct")
}
Expand Down

0 comments on commit 33b5d38

Please sign in to comment.