Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
CTF
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grzegorz
CTF
Commits
8ab1c216
Commit
8ab1c216
authored
Apr 05, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quick fix for query data
parent
9c0d1943
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
WebTask.java
.../com/telephoners/krakyournet/ctf/beans/tasks/WebTask.java
+3
-2
TaskResource.java
...m/telephoners/krakyournet/ctf/resources/TaskResource.java
+5
-1
No files found.
service/src/main/java/com/telephoners/krakyournet/ctf/beans/tasks/WebTask.java
View file @
8ab1c216
...
...
@@ -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
));
}
...
...
service/src/main/java/com/telephoners/krakyournet/ctf/resources/TaskResource.java
View file @
8ab1c216
...
...
@@ -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
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment