Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MilderJoghurt
rlf-server
Commits
e3e278c5
Commit
e3e278c5
authored
Jun 22, 2015
by
Fjen Undso
Browse files
SessionController: disable getSessions() for production mode
parent
5e39a420
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/controllers/SessionController.java
View file @
e3e278c5
...
...
@@ -7,6 +7,7 @@ import play.libs.Json;
import
play.mvc.BodyParser
;
import
play.mvc.Controller
;
import
play.mvc.Result
;
import
play.api.Play
;
import
com.fasterxml.jackson.databind.JsonNode
;
...
...
@@ -16,13 +17,17 @@ import com.fasterxml.jackson.databind.JsonNode;
public
class
SessionController
extends
Controller
{
/**
* Gets details of all {@link Session}s
* Gets details of all {@link Session}s
(development mode only)
*
* @return list of all Sessions
*/
public
static
Result
getSessions
()
{
List
<
Session
>
sessions
=
Session
.
find
.
all
();
return
ok
(
Json
.
toJson
(
sessions
));
// 200
if
(
Play
.
isProd
(
Play
.
current
()))
{
return
notFound
();
// 404 if in production
}
else
{
List
<
Session
>
sessions
=
Session
.
find
.
all
();
return
ok
(
Json
.
toJson
(
sessions
));
// 200
}
}
/**
...
...
Write
Preview
Supports
Markdown
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