diff options
author | Vitaly Takmazov | 2016-12-16 15:41:14 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-16 15:41:14 +0300 |
commit | 300a0439b2a6e26d9025247ef780c886616d4ae1 (patch) | |
tree | bcdb7613c2c5f37b870cbe18241894dba9428fae /juick-www/src/main/java/com/juick/www/VKontakteLogin.java | |
parent | 18a8595d2150edc92084c94b9dbb8f4309d3ed36 (diff) |
CharEncoding.UTF_8
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/VKontakteLogin.java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/VKontakteLogin.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/juick-www/src/main/java/com/juick/www/VKontakteLogin.java b/juick-www/src/main/java/com/juick/www/VKontakteLogin.java index 6b1d4571..92b22805 100644 --- a/juick-www/src/main/java/com/juick/www/VKontakteLogin.java +++ b/juick-www/src/main/java/com/juick/www/VKontakteLogin.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.juick.server.UserQueries; import com.juick.www.vk.Token; import com.juick.www.vk.UsersResponse; +import org.apache.commons.lang3.CharEncoding; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.EmptyResultDataAccessException; @@ -57,12 +58,12 @@ public class VKontakteLogin { String code = request.getParameter("code"); if (code == null || code.equals("")) { response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); - response.setHeader("Location", "https://oauth.vk.com/authorize?client_id=" + VK_APPID + "&redirect_uri=" + URLEncoder.encode(VK_REDIRECT, "utf-8") + "&scope=friends,wall,offline&response_type=code"); + response.setHeader("Location", "https://oauth.vk.com/authorize?client_id=" + VK_APPID + "&redirect_uri=" + URLEncoder.encode(VK_REDIRECT, CharEncoding.UTF_8) + "&scope=friends,wall,offline&response_type=code"); return; } - String tokenjson = Utils.fetchURL("https://oauth.vk.com/access_token?client_id=" + VK_APPID + "&redirect_uri=" + URLEncoder.encode(VK_REDIRECT, "utf-8") + "&client_secret=" + VK_SECRET + "&code=" + URLEncoder.encode(code, "utf-8")); + String tokenjson = Utils.fetchURL("https://oauth.vk.com/access_token?client_id=" + VK_APPID + "&redirect_uri=" + URLEncoder.encode(VK_REDIRECT, CharEncoding.UTF_8) + "&client_secret=" + VK_SECRET + "&code=" + URLEncoder.encode(code, CharEncoding.UTF_8)); if (tokenjson == null || tokenjson.isEmpty()) { logger.error("VK TOKEN EMPTY"); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); |