IDEA-101238 fixed url parameter encoding for youtrack time tracking
authorEvgeny Naumenko <Evgeny.Naumenko@jetbrains.com>
Tue, 10 Nov 2015 10:38:35 +0000 (13:38 +0300)
committerEvgeny Naumenko <Evgeny.Naumenko@jetbrains.com>
Tue, 10 Nov 2015 10:38:35 +0000 (13:38 +0300)
plugins/tasks/tasks-core/src/com/intellij/tasks/youtrack/YouTrackRepository.java

index c67fa68343683404883817530c0989d4e80097bf..7e8667c64bd04d0db037dce41ac139c35615098d 100644 (file)
@@ -352,7 +352,8 @@ public class YouTrackRepository extends BaseRepositoryImpl {
   @Override
   public void updateTimeSpent(@NotNull LocalTask task, @NotNull String timeSpent, @NotNull String comment) throws Exception {
     checkVersion();
-    final HttpMethod method = doREST("/rest/issue/execute/" + task.getId() + "?command=work+Today+" + timeSpent.replaceAll(" ", "+") + "+" + comment, true);
+    String command = encodeUrl(String.format("work Today %s %s", timeSpent, comment));
+    final HttpMethod method = doREST("/rest/issue/execute/" + task.getId() + "?command=" + command, true);
     try {
       if (method.getStatusCode() != 200) {
         InputStream stream = method.getResponseBodyAsStream();