Server cannot connect with password carrying '@' character.

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.4.2
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      If the password carries '@' character in the connection string, the connection doesn't happen and throws error.

      E.g if the password is 'somepassword1@' in a connection string, it returns only 'somepassword1'. So, this password fails to connect to the database.

      FileName : MongoUrlBuilder.cs
      Git Path: https://github.com/mongodb/mongo-csharp-driver/blob/master/Driver/Core/MongoUrlBuilder.cs
      Line 438-441
      const string pattern =
      @"^mongodb://" +
      @"((?<username>[^:])?<password>[^@])@)?" +
      @"(?<servers>" + serverPattern + "(," + serverPattern + ")*)" +
      @"(/(?<database>[^?]+)?(?(?<query>.*))?)?$";
      Match match = Regex.Match(url, pattern);

      Thanks,
      Prithiraj

            Assignee:
            Robert Stam
            Reporter:
            Prithiraj Sengupta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: