[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: mitm proxies reques
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: mitm proxies request using the same method used by the client. |
Date: |
Thu, 27 Apr 2017 15:49:09 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new a489a58 mitm proxies request using the same method used by the client.
a489a58 is described below
commit a489a58fc4dedad93c8eb9f6f6f6540e5d77981f
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Apr 27 15:46:52 2017 +0200
mitm proxies request using the same method used by
the client.
---
src/mitm/mitm.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/mitm/mitm.py b/src/mitm/mitm.py
old mode 100644
new mode 100755
index 0b6f9bc..30957a5
--- a/src/mitm/mitm.py
+++ b/src/mitm/mitm.py
@@ -31,8 +31,8 @@ import json
from random import randint
from datetime import datetime
-# FIXME make this as a standalone executable, and accept
-# the exchange url as a cli option.
+# FIXME make this as a standalone executable, like taler-merchant-mitm.
+# accept the exchange url as a cli option.
app = Flask(__name__)
app.secret_key = base64.b64encode(os.urandom(64)).decode('utf-8')
@@ -40,6 +40,9 @@ logger = logging.getLogger(__name__)
exchange_url = os.environ.get("TALER_EXCHANGE_URL")
assert(None != exchange_url)
+# The functions taking 'resp' as parameter are responsible for
+# modifying the data to return.
+
def track_transaction(resp):
return resp
@@ -55,8 +58,10 @@ def all(path):
url[0] = xurl[0]
url[1] = xurl[1]
url = urlunparse(url)
- print("Querying " + url)
- r = requests.post(urljoin(url, path), json=body)
+ if "POST" == request.method:
+ r = requests.post(urljoin(url, path), json=body)
+ else:
+ r = requests.get(urljoin(url, path), json=body)
resp = dict()
if "application/json" == r.headers["Content-Type"]:
resp = r.json()
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: mitm proxies request using the same method used by the client.,
gnunet <=