Skip to content

Commit

Permalink
Merge pull request #6228 from brave/rate_brave_encoding_dp
Browse files Browse the repository at this point in the history
Update encoding related code
  • Loading branch information
deeppandya authored Jul 28, 2020
2 parents de7326c + 63287d1 commit 86c219f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.chromium.chrome.browser.ntp_background_images.NTPBackgroundImagesBridge;

public class RateFeedbackUtils {
private static final String TAG = "Rate";
private static final String TAG = "Rate_Brave";
private static final String RATE_URL = "https://laptop-updates.brave.com/1/feedback";

public interface RateFeedbackCallback {
Expand Down Expand Up @@ -92,15 +92,15 @@ private static void sendRateFeedback(String userSelection, String userFeedback)
jsonParam.put("api_key", mNTPBackgroundImagesBridge.getReferralApiKey());

OutputStream outputStream = urlConnection.getOutputStream();
byte[] input = jsonParam.toString().getBytes(StandardCharsets.UTF_8.toString());
byte[] input = jsonParam.toString().getBytes(StandardCharsets.UTF_8.name());
outputStream.write(input, 0, input.length);
outputStream.flush();
outputStream.close();

int HttpResult = urlConnection.getResponseCode();
if (HttpResult == HttpURLConnection.HTTP_OK) {
BufferedReader br = new BufferedReader(new InputStreamReader(
urlConnection.getInputStream(), StandardCharsets.UTF_8.toString()));
urlConnection.getInputStream(), StandardCharsets.UTF_8.name()));
String line = null;
while ((line = br.readLine()) != null) {
sb.append(line + "\n");
Expand Down

0 comments on commit 86c219f

Please sign in to comment.