mirror of
https://github.com/Steffo99/referer.steffo.eu.git
synced 2024-11-23 03:24:21 +00:00
First commit
This commit is contained in:
commit
97569fef6f
2 changed files with 22 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.idea/
|
21
app.py
Normal file
21
app.py
Normal 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()
|
Loading…
Reference in a new issue