1
Fork 0
mirror of https://github.com/Steffo99/referer.steffo.eu.git synced 2024-11-23 11:34:19 +00:00

First commit

This commit is contained in:
Steffo 2019-08-05 11:13:56 +02:00
commit 97569fef6f
2 changed files with 22 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.idea/

21
app.py Normal file
View file

@ -0,0 +1,21 @@
import flask as f
app = f.Flask(__name__)
@app.route("/")
def root_page():
return '<a href="/referer">Click on me!</a>'
@app.route('/referer')
def referer_page():
referer = f.request.headers.get("Referer")
if referer:
return f"Referer: {referer}"
else:
return "No Referer header was sent."
if __name__ == '__main__':
app.run()