 
 
 (defn- domain [url]
-  (last (re-find #"^https?://([^/]+)" url)))
+  (last (re-find #"^https?://([^/]+)" (str url))))
 
 (defn- badge-image [input]
   (let [image (if (map? input) (get-in input [:badge :image] "") input)]


(defmethod verify-assertion :v2.0 [url asr]
  (let [kind (get-in asr [:verify :type] (get-in asr [:verification :type]))]
    (when (and url (or (= kind "hosted") (= kind "HostedBadge")))
      (if (not= (:id asr) url)
        (throw (IllegalArgumentException. "invalid assertion, verify url mismatch")))
      (if (map? (:badge asr))
        (if (not= (domain (get-in asr [:badge :id])) (domain (:id asr)))
          (throw (IllegalArgumentException. "invalid assertion, verify url mismatch")))
        (if (not= (domain (get-in asr [:verify :url])) (domain (:badge asr)))
          (throw (IllegalArgumentException. "invalid assertion, verify url mismatch")))))))

(defmethod verify-assertion :default [url asr]

                                                            :mtime now}) (:evidence assertion))
                   :else [])
        badge  (if (map? (:badge assertion)) (:badge assertion) (http/json-get (:badge assertion)))
        related (->> (get badge :related [])
                     (map #(http/json-get (:id %)))
                     (remove #(nil? ((keyword "@language") %))))
        default-language (get badge (keyword "@language") "")]
    (assoc initial
           :badge (merge {:id ""
                          :remote_url nil
