Last active
July 31, 2019 18:00
-
-
Save ablanathtanalba/45a785382609c1e75135c53345e423d9 to your computer and use it in GitHub Desktop.
flask app server for testing PB pixel tracking heuristic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, response | |
app = Flask(__name__) | |
# example string taken from actual results | |
COOKIE = '82d07aeb-ce29-4e6d-a35f-76ce3545fa38' | |
@app.route('/') | |
def route_pixel_tracking_cookie_status(): | |
response.status = '200' | |
response.headers('Set-Cookie') = COOKIE | |
return response | |
# TODO: decide whether to serve up some actual markdown with an img tag (src for which would carry COOKIE in the request | |
# or to make a request here on behalf of the fake page? | |
# if from here, could be something like: | |
## @app.route('/', methods=['GET']) | |
## def pixel_request_carrying_cookie(): | |
## request.args(COOKIE) | |
if __name__ = "__main__": | |
app.run(host='0.0.0.0', debug=True, port=80) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment