Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ablanathtanalba/45a785382609c1e75135c53345e423d9 to your computer and use it in GitHub Desktop.
Save ablanathtanalba/45a785382609c1e75135c53345e423d9 to your computer and use it in GitHub Desktop.
flask app server for testing PB pixel tracking heuristic
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