lib/owasp_zap/spider.rb in owasp_zap-0.0.82 vs lib/owasp_zap/spider.rb in owasp_zap-0.0.83

- old
+ new

@@ -18,10 +18,18 @@ def stop RestClient::get "#{@base}/spider/action/stop/?zapapiformat=JSON" end def status - RestClient::get "#{@base}/spider/view/status/?zapapiformat=JSON" - end + ret = JSON.parse(RestClient::get("#{@base}/spider/view/status/?zapapiformat=JSON")) + if ret.has_key? "status" + ret["status"] + else + 100 # it means no running + end + end + def running? + self.status != 100 + end end end