19316: Change wb1 and sdk/cli to Oj.safe_load / strict_load.
[arvados.git] / apps / workbench / app / models / arvados_api_client.rb
index 3c9bfa793daa5a8ba143cbbf8fc40122654b6fff..47fcc4ce51ffe1aafb288453b9d9c6a0b777bd0d 100644 (file)
@@ -40,7 +40,7 @@ class ArvadosApiClient
     def initialize(request_url, api_response)
       @api_status = api_response.status_code
       @api_response_s = api_response.content
-      @api_response = Oj.load(@api_response_s, :symbol_keys => true)
+      @api_response = Oj.strict_load(@api_response_s, :symbol_keys => true)
       errors = @api_response[:errors]
       if errors.respond_to?(:join)
         errors = errors.join("\n\n")
@@ -167,7 +167,7 @@ class ArvadosApiClient
     end
 
     begin
-      resp = Oj.load(msg.content, :symbol_keys => true)
+      resp = Oj.strict_load(msg.content, :symbol_keys => true)
     rescue Oj::ParseError
       resp = nil
     end