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:
@ -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
|
||||||
|
Reference in New Issue
Block a user