Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-9852

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Low
    • None
    • 4.10.1, 5.1.0
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bstuart Ben Stuart
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: