Browse Source

tests fixed

master
Christian Mueller 12 years ago
parent
commit
d2b8b0dd94
  1. 8
      src/notehub/handler.clj
  2. 7
      src/notehub/storage.clj

8
src/notehub/handler.clj

@ -93,14 +93,14 @@
(response 500))) (response 500)))
(response 400))) (response 400)))
(POST "/update-note" [note-id note password] (POST "/update-note" [noteID note password]
(let [pid "NoteHub" (let [pid "NoteHub"
psk (storage/get-psk pid) psk (storage/get-psk pid)
params {:noteID note-id :note note :password password :pid pid}] params {:noteID noteID :note note :password password :pid pid}]
(if (storage/valid-publisher? pid) (if (storage/valid-publisher? pid)
(let [resp (api/update-note (assoc params (let [resp (api/update-note (assoc params
:signature :signature
(storage/sign pid psk note-id note password)))] (storage/sign pid psk noteID note password)))]
(if (get-in resp [:status :success]) (if (get-in resp [:status :success])
(redirect (:longURL resp)) (redirect (:longURL resp))
(response 403))) (response 403)))

7
src/notehub/storage.clj

@ -36,10 +36,9 @@
(redis :hset :publisher-key pid psk) (redis :hset :publisher-key pid psk)
psk))) psk)))
; This was uncommented, because the DB isn't (when (and (get-setting :dev-mode)
; available on heroku at compile time (not (valid-publisher? "NoteHub"))
#_ (when-not (valid-publisher? "NoteHub") (register-publisher "NoteHub")))
(register-publisher "NoteHub"))
(defn revoke-publisher [pid] (defn revoke-publisher [pid]
(redis :hdel :publisher-key pid)) (redis :hdel :publisher-key pid))

Loading…
Cancel
Save