     else
         # Add the credentials in the url
         auth = "#{params.id}:#{params.target.token}"
-        url = params.target.recipientUrl.replace "://", "://#{auth}@"
+        url = addProtocol params.target.recipientUrl
+        url = url.replace "://", "://#{auth}@"
 
         # Remove last slash in recipient's url
         if url.charAt(url.length - 1) is '/'


# Send a revocation request to the specified url
module.exports.sendRevocation = (url, path, params, callback) ->
    remote = request.createClient url
    remote.del path, params, (err, result, body) ->
        handleNotifyResponse err, result, body, callback

            # Avoid empty usernames
            if not params.sharerName? or (params.sharerName is '')
                params.sharerName = params.sharerUrl.replace "https://", ""

            # Add https if not specified
            url = addProtocol url
            # Send to recipient
            remote = request.createClient url
            remote.post path, params, (err, result, body) ->
