Commit 2f110b49 authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

cleanup

parent 6ca9e4de
...@@ -22,19 +22,7 @@ import java.io.InputStream; ...@@ -22,19 +22,7 @@ import java.io.InputStream;
@Path(value = "/proxy/task") @Path(value = "/proxy/task")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public class ProxyResource { public class ProxyResource {
/*
@GET
@Path("{task_id}/{path: .*}")
@Produces("text/html; charset=UTF-8")
public InputStream foo(final @PathParam("task_id") String taskId,
final @PathParam("path") String path) throws IOException {
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpGet httpget = new HttpGet("https://pl.wikipedia.org/" + taskId + "/" + path);
CloseableHttpResponse execute = httpClient.execute(httpget);
HttpEntity entity = execute.getEntity();
return entity.getContent();
}
*/
@GET @GET
@Path("{task_id}/{path: .*}") @Path("{task_id}/{path: .*}")
@Produces("text/html; charset=UTF-8") @Produces("text/html; charset=UTF-8")
...@@ -43,7 +31,6 @@ public class ProxyResource { ...@@ -43,7 +31,6 @@ public class ProxyResource {
final @PathParam("path") String path) throws IOException { final @PathParam("path") String path) throws IOException {
CloseableHttpClient httpClient = HttpClients.createDefault(); CloseableHttpClient httpClient = HttpClients.createDefault();
HttpGet httpget = new HttpGet("http://192.168.56.101/"); HttpGet httpget = new HttpGet("http://192.168.56.101/");
// HttpGet httpget = new HttpGet("http://http://192.168.56.101/" + taskId + "/" + path);
httpget.setHeader("CTF-User", user.getName()); httpget.setHeader("CTF-User", user.getName());
CloseableHttpResponse execute = httpClient.execute(httpget); CloseableHttpResponse execute = httpClient.execute(httpget);
HttpEntity entity = execute.getEntity(); HttpEntity entity = execute.getEntity();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment