This commit is contained in:
parent
b0adf42de9
commit
265c7f6e85
2
app.py
2
app.py
@ -2,7 +2,7 @@ import sentry_sdk
|
|||||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
import os
|
import os
|
||||||
from rediscleint import redis_client
|
from redisclient import redis_client
|
||||||
from endpoints import IPEndpoint
|
from endpoints import IPEndpoint
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
from redisclient import redis_client
|
from redisclient import redis_client
|
||||||
from flask import jsonify
|
from flask import jsonify, request, Response
|
||||||
from flask_classful import FlaskView
|
from flask_classful import FlaskView
|
||||||
|
|
||||||
|
|
||||||
@ -9,5 +9,7 @@ class IPEndpoint(FlaskView):
|
|||||||
def post(self):
|
def post(self):
|
||||||
consumer = json.loads(redis_client.get('currentConsumer'))
|
consumer = json.loads(redis_client.get('currentConsumer'))
|
||||||
consumer['Host'] = request.json['ip']
|
consumer['Host'] = request.json['ip']
|
||||||
strconsumer = json.dumps(consumer)
|
strconsumer = json.dumps(consumer).encode('utf-8')
|
||||||
redis_client.set('currentConsumer', strconsumer)
|
redis_client.set('currentConsumer', strconsumer)
|
||||||
|
|
||||||
|
return Response(status=204)
|
Reference in New Issue
Block a user