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
ace2915e
Commit
ace2915e
authored
Apr 10, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use httpMethod
parent
cb3c2b61
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
TaskRequestContext.java
...oners/krakyournet/ctf/beans/tasks/TaskRequestContext.java
+4
-3
TaskResource.java
...m/telephoners/krakyournet/ctf/resources/TaskResource.java
+3
-2
No files found.
service/src/main/java/com/telephoners/krakyournet/ctf/beans/tasks/TaskRequestContext.java
View file @
ace2915e
package
com
.
telephoners
.
krakyournet
.
ctf
.
beans
.
tasks
;
import
com.telephoners.krakyournet.ctf.beans.User
;
import
org.eclipse.jetty.http.HttpMethod
;
import
java.util.Map
;
public
class
TaskRequestContext
{
private
String
httpMethod
;
//todo: use class
private
HttpMethod
httpMethod
;
//todo: use class
private
User
user
;
private
String
path
;
private
String
body
;
private
Map
<
String
,
String
>
headers
;
public
TaskRequestContext
withHttpMethod
(
String
httpMethod
)
public
TaskRequestContext
withHttpMethod
(
HttpMethod
httpMethod
)
{
this
.
httpMethod
=
httpMethod
;
return
this
;
...
...
@@ -40,7 +41,7 @@ public class TaskRequestContext
return
this
;
}
public
String
getHttpMethod
()
public
HttpMethod
getHttpMethod
()
{
return
httpMethod
;
}
...
...
service/src/main/java/com/telephoners/krakyournet/ctf/resources/TaskResource.java
View file @
ace2915e
...
...
@@ -8,6 +8,7 @@ import com.telephoners.krakyournet.ctf.core.ApplicationConfiguration;
import
com.telephoners.krakyournet.ctf.helpers.StreamUtils
;
import
com.telephoners.krakyournet.ctf.repositories.TasksRepository
;
import
io.dropwizard.auth.Auth
;
import
org.eclipse.jetty.http.HttpMethod
;
import
org.glassfish.jersey.server.ContainerRequest
;
import
javax.inject.Inject
;
...
...
@@ -71,7 +72,7 @@ public class TaskResource
}
Map
<
String
,
String
>
headers
=
extractProxiedHeaders
(
containerRequestContext
.
getHeaders
());
//todo: inline
TaskRequestContext
taskRequestContext
=
new
TaskRequestContext
()
.
withHttpMethod
(
"POST"
)
.
withHttpMethod
(
HttpMethod
.
GET
)
.
withUser
(
user
)
.
withPath
(
fullPath
)
.
withHeaders
(
headers
);
...
...
@@ -106,7 +107,7 @@ public class TaskResource
Map
<
String
,
String
>
headers
=
extractProxiedHeaders
(
containerRequestContext
.
getHeaders
());
//todo: inline
TaskRequestContext
taskRequestContext
=
new
TaskRequestContext
()
.
withHttpMethod
(
"POST"
)
.
withHttpMethod
(
HttpMethod
.
POST
)
.
withUser
(
user
)
.
withPath
(
fullPath
)
.
withBody
(
body
)
...
...
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