emmett-framework / granian

A Rust HTTP server for Python applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider suport for custom `Server` header

2-5 opened this issue · comments

commented

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