diff --git a/API.md b/API.md index f58eed8..43b76d8 100644 --- a/API.md +++ b/API.md @@ -85,6 +85,7 @@ The Signature is the MD5 hash of the following string concatenation: pid + psk + note The signature serves as a proof, that the request is authentic and will be issued by the publisher corresponding to the provided PID. Please note, that _all_ of the values used in the signature computation, should be identical to the values passed with the request itself. +Ensure, that your note contains only `\\n` symbols as line breaks! The parameters specifying the theme name and fonts are optional and only impact the URLs returned back. @@ -126,6 +127,7 @@ The Signature is the MD5 hash of the following string concatenation: pid + psk + noteID + note + password Please note, that all of the values used in the signature computation, should be identical to the values passed with the request itself. +Ensure, that your note contains only `\\n` symbols as line breaks! The response of the server will contain the fields `longURL`, `shortURL`, `status`. diff --git a/resources/public/js/main.js b/resources/public/js/main.js index ac48541..f6f4ce0 100644 --- a/resources/public/js/main.js +++ b/resources/public/js/main.js @@ -5,9 +5,7 @@ var timerDelay = iosDetected ? 800 : 400; var show = function(elem) { elem.style.display = "block" } var $note, $action, $preview, $plain_password, $input_elems, $dashed_line, updatePreview; -var md5 = function (input) { - return hex_md5(input.replace(/[\n\r]/g, "")); -} +var md5 = hex_md5; function md2html(input){ return marked(input); diff --git a/src/notehub/storage.clj b/src/notehub/storage.clj index ec61bb4..c6a6481 100644 --- a/src/notehub/storage.clj +++ b/src/notehub/storage.clj @@ -9,7 +9,7 @@ (defn sign "Returns the MD5 hash for the concatenation of all passed parameters" [& args] - (let [input (apply str args)] + (let [input (sreplace (apply str args) #"\r*" "")] (do (.reset md5Instance) (.update md5Instance (.getBytes input)) (apply str