mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-29 07:21:27 +00:00
Added response encoding
This commit is contained in:
parent
1019679140
commit
9dd3c4f33b
2
main.py
2
main.py
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from flask import Flask, jsonify, request
|
from flask import Flask, jsonify, request
|
||||||
from flask_restful import Resource, Api, reqparse
|
from flask_restful import Resource, Api, reqparse
|
||||||
|
import base64
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import ast
|
import ast
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -18,6 +19,7 @@ def getDkimKey():
|
||||||
domain = domain.rstrip("\n")
|
domain = domain.rstrip("\n")
|
||||||
catProcess = subprocess.Popen(["cat", "/var/dkim/" + domain + ".selector.txt"], stdout=subprocess.PIPE)
|
catProcess = subprocess.Popen(["cat", "/var/dkim/" + domain + ".selector.txt"], stdout=subprocess.PIPE)
|
||||||
dkim = catProcess.communicate()[0]
|
dkim = catProcess.communicate()[0]
|
||||||
|
dkim = base64.b64encode(dkim.encode());
|
||||||
print(dkim)
|
print(dkim)
|
||||||
return jsonify(dkim)
|
return jsonify(dkim)
|
||||||
@app.route("/pythonVersion", methods=["GET"])
|
@app.route("/pythonVersion", methods=["GET"])
|
||||||
|
|
Loading…
Reference in a new issue