How to prevent Gunicorn from returning a 'Server' http header?

后端 未结 6 1107
走了就别回头了
走了就别回头了 2021-02-05 06:51

I would like to mask the version or remove the header altogether.

6条回答
  •  名媛妹妹
    2021-02-05 07:30

    It's better to change it to something unique than remove it. You don't want to risk, e.g., spiders thinking you're noncompliant. Changing it to the name of software you aren't using can cause similar problems. Making it unique will prevent the same kind of assumptions ever being made. I recommend something like this:

    import gunicorn
    gunicorn.SERVER_SOFTWARE = 'intentionally-undisclosed-gensym384763'
    

提交回复
热议问题