Commit e3e278c5 authored by Fjen Undso's avatar Fjen Undso
Browse files

SessionController: disable getSessions() for production mode

parent 5e39a420
......@@ -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
}
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment