From acf96763d8877ae8dd1caf61052cdf63f057d3bc Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Sat, 22 Apr 2017 11:13:05 +0200 Subject: [PATCH] Added flag to disable failover for provider Added a flag to `webpaste-provider' to disable the failover mechanic so one can create private providers which failovers to public providers and leaks data. --- webpaste.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webpaste.el b/webpaste.el index c96d77d..807a07d 100644 --- a/webpaste.el +++ b/webpaste.el @@ -65,6 +65,7 @@ each run.") (type "POST") (parser 'buffer-string) (post-data '()) + (no-failover nil) post-field success) "Macro to create the lambda function for a provider. @@ -82,6 +83,7 @@ Usage: `request`. This defaults to 'buffer-string. :post-data Default post fields sent to service. Defaults to nil. :post-field Name of the field to insert the code into. +:no-failover Set to t to not allow doing failovers, Defaults to nil. :success Callback sent to `request`, look up how to write these in the documentation for `request`" (lambda (text) @@ -99,7 +101,8 @@ Usage: :error (cl-function (lambda (&key error-thrown &allow-other-keys) (message "Got error: %S" error-thrown) - (webpaste-paste-text text)))) + (if (eq no-failover nil) + (webpaste-paste-text text))))) nil))