No user found error when curling for usernames with a special character

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Low
    • None
    • Affects Version/s: 4.10.1, 5.1.0
    • Component/s: None
    • None
    • Severity 3 - Minor

      Summary

      If you try to find a user with a special character in it's username (user@email.com) with Bitbucket's REST API you receive a NoSuchUserException:

      {"errors":[{"context":null,"message":"User user@gmail.com does not exist.","exceptionName":"com.atlassian.bitbucket.user.NoSuchUserException"}]}
      

      The REST Endpoint tested was:

      http://localhost:7990/rest/api/1.0/users/user@gmail.com
      

      This same error occurs if you use URL escape characters:

      http://localhost:7990/rest/api/1.0/users/bstuart%40gmail.com
      

      Steps to Reproduce

      1. Create a user with a username like user@gmail.com
      2. Use any method to GET a user at the endpoint http://localhost:7990/rest/api/1.0/users/

      Expected Results

      A response like the following:

      {
          "name": "user@gmail.com",
          "emailAddress": "user@gmail.com",
          "id": 1,
          "displayName": "user@gmail.com",
          "active": true,
          "slug": "user@gmail.com",
          "type": "NORMAL",
          "links": {
              "self": [
                  {
                      "href": "http://localhost:7990/users/user@gmail.com"
                  }
              ]
          }
      }
      

      Actual Results

      The below exception is thrown:

      {"errors":[{"context":null,"message":"User user@gmail.com does not exist.","exceptionName":"com.atlassian.bitbucket.user.NoSuchUserException"}]}
      

      Workaround

      There is no workaround currently.

            Assignee:
            Unassigned
            Reporter:
            Ben Stuart (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: