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
cca7ed53
Commit
cca7ed53
authored
Apr 03, 2016
by
Grzegorz Pietrusza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix redirect
parent
6cea2a25
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
15 deletions
+2
-15
Gruntfile.js
Gruntfile.js
+1
-2
UtilResource.java
...m/telephoners/krakyournet/ctf/resources/UtilResource.java
+1
-3
redirect.html
service/src/main/resources/assets/redirect.html
+0
-10
No files found.
Gruntfile.js
View file @
cca7ed53
...
...
@@ -37,8 +37,7 @@ module.exports = function (grunt) {
'./service/src/main/resources/assets_build/scoresheet.html'
:
'./service/src/main/resources/assets/scoresheet.html'
,
'./service/src/main/resources/assets_build/submitflag.html'
:
'./service/src/main/resources/assets/submitflag.html'
,
'./service/src/main/resources/assets_build/task.html'
:
'./service/src/main/resources/assets/task.html'
,
'./service/src/main/resources/assets_build/tasks.html'
:
'./service/src/main/resources/assets/tasks.html'
,
'./service/src/main/resources/assets_build/redirect.html'
:
'./service/src/main/resources/assets/redirect.html'
'./service/src/main/resources/assets_build/tasks.html'
:
'./service/src/main/resources/assets/tasks.html'
}
}
},
...
...
service/src/main/java/com/telephoners/krakyournet/ctf/resources/UtilResource.java
View file @
cca7ed53
...
...
@@ -6,7 +6,6 @@ import com.telephoners.krakyournet.ctf.beans.User;
import
com.telephoners.krakyournet.ctf.core.ApplicationConfiguration
;
import
com.telephoners.krakyournet.ctf.repositories.TeamsRepository
;
import
io.dropwizard.auth.Auth
;
import
org.apache.commons.io.FileUtils
;
import
javax.inject.Inject
;
import
javax.inject.Singleton
;
...
...
@@ -16,7 +15,6 @@ import javax.ws.rs.Produces;
import
javax.ws.rs.core.HttpHeaders
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
java.io.File
;
import
java.io.IOException
;
@Singleton
...
...
@@ -24,6 +22,7 @@ import java.io.IOException;
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
class
UtilResource
{
private
static
String
redirectHtml
=
"<!DOCTYPE html><html lang=\"en\" ng-app=\"ctfApp\"><head></head><script type=\"text/javascript\">window.location = \"http://\" + window.location.host;</script></html>"
;
private
final
TeamsRepository
teamsRepository
;
private
final
ApplicationConfiguration
applicationConfiguration
;
...
...
@@ -65,7 +64,6 @@ public class UtilResource
@Path
(
"/auth"
)
public
Response
auth
(
@Auth
User
user
)
throws
IOException
{
String
redirectHtml
=
new
String
(
FileUtils
.
readFileToByteArray
(
new
File
(
"service/src/main/resources/assets/redirect.html"
)));
return
Response
.
ok
()
.
entity
(
redirectHtml
)
.
header
(
HttpHeaders
.
CONTENT_TYPE
,
"text/html"
)
...
...
service/src/main/resources/assets/redirect.html
deleted
100644 → 0
View file @
6cea2a25
<!DOCTYPE html>
<html
lang=
"en"
ng-app=
"ctfApp"
>
<head>
</head>
<script
type=
"text/javascript"
>
window
.
location
=
"http://"
+
window
.
location
.
host
;
</script>
</body>
</html>
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