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
8f2f8d12
Commit
8f2f8d12
authored
Apr 05, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
path query parameters in proxy request
parent
5eb501f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
TaskResource.java
...m/telephoners/krakyournet/ctf/resources/TaskResource.java
+8
-2
No files found.
service/src/main/java/com/telephoners/krakyournet/ctf/resources/TaskResource.java
View file @
8f2f8d12
...
...
@@ -4,12 +4,15 @@ import com.telephoners.krakyournet.ctf.beans.User;
import
com.telephoners.krakyournet.ctf.beans.tasks.Task
;
import
com.telephoners.krakyournet.ctf.repositories.TasksRepository
;
import
io.dropwizard.auth.Auth
;
import
org.glassfish.jersey.server.ContainerRequest
;
import
javax.inject.Inject
;
import
javax.inject.Singleton
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.container.ContainerRequestContext
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.Response
;
import
java.io.IOException
;
...
...
@@ -29,10 +32,13 @@ public class TaskResource
@GET
public
Response
getTask
(
@Auth
User
user
,
final
@PathParam
(
"task_level"
)
int
taskLevel
,
final
@PathParam
(
"path"
)
String
path
)
throws
IOException
final
@PathParam
(
"path"
)
String
path
,
@Context
ContainerRequestContext
containerRequestContext
)
throws
IOException
{
Task
task
=
tasksRepository
.
getByLevel
(
taskLevel
);
//todo: refactor, path not necessary in textTasks
return
Response
.
ok
().
entity
(
task
.
getTextForUser
(
user
,
path
)).
build
();
ContainerRequest
context
=
(
ContainerRequest
)
containerRequestContext
;
String
fullPath
=
String
.
format
(
"%s?%s"
,
path
,
context
.
getRequestUri
().
getQuery
());
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