allow numbers to be passed via std.in (numbers are valid json, but crashed when we tried to access them in a hash way. This is now prevented.)

This commit is contained in:
Ralf Teusner
2018-03-01 16:09:29 +01:00
parent 6f95c1b41c
commit 1004acd1d5

View File

@ -167,7 +167,7 @@ class SubmissionsController < ApplicationController
# if the command is 'client_kill', send it to docker otherwise. # if the command is 'client_kill', send it to docker otherwise.
begin begin
parsed = JSON.parse(data) parsed = JSON.parse(data)
if parsed['cmd'] == 'client_kill' if parsed.class == Hash && parsed['cmd'] == 'client_kill'
Rails.logger.debug("Client exited container.") Rails.logger.debug("Client exited container.")
@docker_client.kill_container(result[:container]) @docker_client.kill_container(result[:container])
else else