granian icon indicating copy to clipboard operation
granian copied to clipboard

Consider suport for custom `Server` header

Open 2-5 opened this issue 1 year ago • 0 comments

Right now Granian returns a hard-coded Server: granian header. Consider allowing it's customization, mainly to make it (a bit) harder to profile and attack.

If the app returns a Server header, you end up with two of them:

proto.response_str(
    status=200,
    headers=[
        ("content-type", "text/plain"),
        ("server", "MyServer"),
    ],
    body=f"Hello, world!",
)
HTTP/1.1 200 OK
server: granian
server: MyServer
content-type: text/plain
content-length: 18
date: Thu, 06 Jun 2024 10:48:46 GMT

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

2-5 avatar Jun 06 '24 10:06 2-5