Skip to content

Commit

Permalink
Add server header
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanvugt committed Aug 22, 2022
1 parent 36d8864 commit cbadaee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def run_server(handlers: typing.Dict):
app = Flask("My Battlesnake")
app = Flask("Battlesnake")

@app.get("/")
def on_info():
Expand All @@ -30,6 +30,13 @@ def on_end():
handlers["end"](game_state)
return "ok"

@app.after_request
def identify_server(response):
response.headers.set(
"server", "battlesnake/github/starter-snake-python"
)
return response

host = "0.0.0.0"
port = int(os.environ.get("PORT", "8000"))

Expand Down

0 comments on commit cbadaee

Please sign in to comment.