Skip to content

Commit dcfd0f0

Browse files
committed
fix SERVER_SOFTWARE property
WSGI spec requires the SERVER_SOFTWARE property containing the name and version. This change fix it and separate the version header from SERVER_SOFTWARE property. We expose the SERVER variable so custom installations can change it in one place without looking much when needed.
1 parent 2f944c9 commit dcfd0f0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

gunicorn/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55

66
version_info = (20, 0, 4)
77
__version__ = ".".join([str(v) for v in version_info])
8-
SERVER_SOFTWARE = "gunicorn"
8+
SERVER = "gunicorn"
9+
SERVER_SOFTWARE = "%s/%s" % (SERVER, __version__)
10+

gunicorn/http/wsgi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from gunicorn.http.message import HEADER_RE
1313
from gunicorn.http.errors import InvalidHeader, InvalidHeaderName
14-
from gunicorn import SERVER_SOFTWARE
14+
from gunicorn import SERVER_SOFTWARE, SERVER
1515
import gunicorn.util as util
1616

1717
# Send files in at most 1GB blocks as some operating systems can have problems
@@ -195,7 +195,7 @@ class Response(object):
195195
def __init__(self, req, sock, cfg):
196196
self.req = req
197197
self.sock = sock
198-
self.version = SERVER_SOFTWARE
198+
self.version = SERVER
199199
self.status = None
200200
self.chunked = False
201201
self.must_close = False

0 commit comments

Comments
 (0)