Minor changes to be similar to other servlets

GSoC/Meterpreter_Web_Console
Matthew Kienow 2018-05-14 17:39:40 -04:00
parent b3a1f2531b
commit f482995f74
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
1 changed files with 14 additions and 10 deletions

View File

@ -4,8 +4,8 @@ module SessionServlet
end
def self.registered(app)
app.post SessionServlet.api_path, &report_session
app.get SessionServlet.api_path, &get_session
app.post SessionServlet.api_path, &report_session
end
#######
@ -16,7 +16,7 @@ module SessionServlet
lambda {
begin
#opts = parse_json_request(request, false)
data = get_db().get_all_sessions()
data = get_db.get_all_sessions()
set_json_response(data)
rescue => e
set_error_on_response(e)
@ -26,14 +26,18 @@ module SessionServlet
def self.report_session
lambda {
job = lambda { |opts|
if (opts[:session_data])
get_db().report_session_dto(opts)
else
get_db().report_session_host_dto(opts)
end
}
exec_report_job(request, &job)
begin
job = lambda { |opts|
if opts[:session_data]
get_db.report_session_dto(opts)
else
get_db.report_session_host_dto(opts)
end
}
exec_report_job(request, &job)
rescue => e
set_error_on_response(e)
end
}
end
end