Minimal example below
# coding=utf8
from flask import Flask, Response
app = Flask(__name__)
@app.route('/')
def hello():
response = Response("!!!")
response.headers[b'Server'] = 'Flask'
return response
In Python 2.7.12, the resulting response has a HTTP header of Server: Flask. In Python 3.5.2, the resulting response has HTTP headers of Server: Werkzeug/0.11.10 Python/3.5.2 and b'Server': Flask. Python 2 has the expected behavior.
Testing from within a Python 3 venv, pip freeze output is:
click==6.6
Flask==0.11.1
itsdangerous==0.24
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.10