Commit 8ab1c216 authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

quick fix for query data

parent 9c0d1943
......@@ -21,7 +21,7 @@ import java.util.List;
public class WebTask extends Task
{
private String url;
private static final Joiner URL_JOINER = Joiner.on("/");
private static final Joiner URL_JOINER = Joiner.on("/"); //todo
public WebTask(String name, int level, String description, List<Flag> flags, String url)
{
......@@ -35,7 +35,8 @@ public class WebTask extends Task
public String getTextForUser(User user, String path) throws IOException
{
String url = URL_JOINER.join(getUrl(), path);
// String url = URL_JOINER.join(getUrl(), path); //todo: rethink
String url = getUrl() + path;
return StreamUtils.readStream(proxyRequest(url, user));
}
......
......@@ -38,7 +38,11 @@ public class TaskResource
Task task = tasksRepository.getByLevel(taskLevel);
//todo: refactor, path not necessary in textTasks
ContainerRequest context = (ContainerRequest) containerRequestContext;
String fullPath = String.format("%s?%s", path, context.getRequestUri().getQuery());
String query = context.getRequestUri().getQuery();
String fullPath = path;
if(query != null) { //todo: refactor
fullPath = fullPath + "?" + query;
}
return Response.ok().entity(task.getTextForUser(user, fullPath)).build();
}
}
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