Skip to content

Commit

Permalink
Merge branch 'add-feedback' of https://github.com/vlead/feedback-portal
Browse files Browse the repository at this point in the history
… into develop
  • Loading branch information
madhavipuliraju committed Nov 1, 2016
2 parents ce5f6d7 + 13349d3 commit c6de5d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/rest/api.org
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_generic_feedback():
abort(500, "the request does not contain data in json")

try:
gateway_ip = str(request.headers.getlist("X-Forwarded-For")[0].rpartition(' ')[-1])
gateway_ip = str(request.access_route[-1])
data_dict["gateway_ip"] = gateway_ip
fb = SystemInterface.add_generic_feedback(data_dict)
return jsonify('{"status":"sucess"}')
Expand Down Expand Up @@ -210,7 +210,7 @@ def get_add_feedback():
abort(400, 'Either lab name or key or version or responses'
' are not passed')
else:
gateway_ip = str(request.remote_addr)
gateway_ip = str(request.access_route[-1])
current_app.logger.debug("lab_name = %s, responses=%s, "
"version=%s, key=%s, "
%(data_dict['lab_name'], data_dict['responses'],
Expand Down Expand Up @@ -644,7 +644,7 @@ class TestGetFeedbackDump(TestCase):
@api.route('/get_gateway_ip', methods=['GET'])
def get_gateway_ip():
try:
gateway_ip = str(request.headers.getlist("X-Forwarded-For")[0].rpartition(' ')[-1])
gateway_ip = str(request.access_route[-1])
return jsonify({'gateway_ip': gateway_ip})
except Exception as e:
return "Error in getting the gateway_ip"
Expand Down

0 comments on commit c6de5d1

Please sign in to comment.