Change-Id: Iba9fc991aee54fcb8b0dc5e5841da24c2d54dfc2 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>tags/v5.0.0.201805151920-m7
throws IOException, ServletException { | throws IOException, ServletException { | ||||
final HttpServletResponse r = (HttpServletResponse) response; | final HttpServletResponse r = (HttpServletResponse) response; | ||||
r.setContentType("text/plain"); | r.setContentType("text/plain"); | ||||
r.setCharacterEncoding("UTF-8"); | |||||
r.setCharacterEncoding(Constants.CHARACTER_ENCODING); | |||||
try (PrintWriter w = r.getWriter()) { | try (PrintWriter w = r.getWriter()) { | ||||
w.print("OK"); | w.print("OK"); | ||||
} | } |
import java.util.List; | import java.util.List; | ||||
import java.util.Map; | import java.util.Map; | ||||
import org.eclipse.jgit.lib.Constants; | |||||
import org.junit.Before; | import org.junit.Before; | ||||
import org.junit.Test; | import org.junit.Test; | ||||
while ((length = inputStream.read(buffer)) != -1) { | while ((length = inputStream.read(buffer)) != -1) { | ||||
result.write(buffer, 0, length); | result.write(buffer, 0, length); | ||||
} | } | ||||
return result.toString("UTF-8"); | |||||
return result.toString(Constants.CHARACTER_ENCODING); | |||||
} | } | ||||
} | } | ||||
} | } |