JetBrains / YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
https://www.jetbrains.com/youtrack
Apache License 2.0
134 stars 105 forks source link

UserManagementService .CreateUser replaces ' ' with '+' #89

Closed FinkoAI closed 4 years ago

FinkoAI commented 4 years ago

Expected behavior

We are using UserManagementService .CreateUser (https://github.com/JetBrains/YouTrackSharp/blob/192/src/YouTrackSharp/Management/UserManagementService.cs#L86) for users creating in our library. In case of sending full name like "FirstName LastName" it should create user with the full name equals "FirstName LastName"

Actual behavior

Actually it works wrong and saves it as string "FirstName+LastName". Probably the reason is WebUtilities.UrlEncode on fullName string (this helper replaces ' ' character with the '+' character).

Also, I think this problem is actual for all POST/PUT requests.

Steps to reproduce the behavior

You can just call UserManagementService .CreateUser with FullName parameter that contains spaces.

maartenba commented 4 years ago

Fresh package has been uploaded to NuGet, should be visible there shortly.

FinkoAI commented 4 years ago

@maartenba Thanks for the quick fix.

FinkoAI commented 4 years ago

@maartenba We have checked the fix. And there is another issue now. Is replaces ' ' character with the '%20'. I guess FormData shouldn't be escaped and it could be passed as is.