mirror of
https://github.com/simon987/Architeuthis.git
synced 2025-12-16 18:19:03 +00:00
Added host rules + minor refactoring
This commit is contained in:
17
test/web.py
17
test/web.py
@@ -1,6 +1,7 @@
|
||||
from flask import Flask, Response
|
||||
import time
|
||||
|
||||
from flask import Flask, Response
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@@ -10,6 +11,18 @@ def slow():
|
||||
return "Hello World!"
|
||||
|
||||
|
||||
@app.route("/echo/<text>")
|
||||
def echo(text):
|
||||
return text
|
||||
|
||||
|
||||
@app.route("/echoh/<text>")
|
||||
def echoh(text):
|
||||
return Response(response="see X-Test header", status=404, headers={
|
||||
"X-Test": text,
|
||||
})
|
||||
|
||||
|
||||
@app.route("/500")
|
||||
def e500():
|
||||
return Response(status=500)
|
||||
@@ -22,7 +35,7 @@ def e404():
|
||||
|
||||
@app.route("/403")
|
||||
def e403():
|
||||
return Response(status=404)
|
||||
return Response(status=403)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user