Skip to content

Commit

Permalink
Add some headers for security
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalk0 committed Oct 25, 2023
1 parent e3e165c commit 5b717eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ async def start_server(self):

# This is the response
async def handler(request):
return web.Response(text=f"{self.user.name} is up")
return web.Response(text=f"{self.user.name} is up", headers={
"X-Frame-Options": "DENY",
"X-Content-Type-Options": "nosniff",
"Content-Security-Policy": "default-src 'self'",
"Server": "Python"
})

app = web.Application()
app.add_routes([web.get('/', handler)])
Expand Down

0 comments on commit 5b717eb

Please sign in to comment.