Skip to content

Commit bb275e3

Browse files
authored
Update app.py
1 parent 4a344fb commit bb275e3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎app.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from flask import Flask
1+
from flask import Flask make_response
22
import os
33

44
app = Flask(__name__)
@@ -22,6 +22,13 @@ def liveness():
2222
def failing():
2323
abort(404)
2424

25+
26+
@app.route("/custom")
27+
def custom():
28+
response = make_response("Custom OK", 200)
29+
response.headers["X-Custom-Header"] = "Value"
30+
return response
31+
2532
@app.route("/data")
2633
def get_data():
2734
body = jsonify({"error": "Too Many Requests", "retry_after": 2})

0 commit comments

Comments
 (0)