Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added encoding for entity sending to gitlab.

Currently the Gitlab decorator does not set an encoding when sending the merge request decoration details to Gitlab, which results in some characters - such as the Cyrillic alphabet - being rendered incorrectly on Gitlab, or if that character found on old \ new path position occurs error in API. Explicitly specifying UTF-8 as the encoding overcome this.
  • Loading branch information
sfaqer committed Sep 16, 2021
1 parent 4049305 commit a565583
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public Discussion addMergeRequestDiscussion(long projectId, long mergeRequestIid

HttpPost httpPost = new HttpPost(targetUrl);
httpPost.addHeader("Content-type", ContentType.APPLICATION_FORM_URLENCODED.getMimeType());
httpPost.setEntity(new UrlEncodedFormEntity(requestContent));
httpPost.setEntity(new UrlEncodedFormEntity(requestContent, StandardCharsets.UTF_8));
return entity(httpPost, Discussion.class, httpResponse -> validateResponse(httpResponse, 201, "Discussion successfully created"));
}

Expand Down

0 comments on commit a565583

Please sign in to comment.