don't normalize headers. fix issue #27

This commit is contained in:
benoitc 2010-03-01 18:04:34 +01:00
parent d33c5b6c86
commit 81ea3c078e
3 changed files with 25 additions and 10 deletions

View File

@ -49,7 +49,7 @@
<div class="document" id="the-configuration-file">
<h1 class="title">The Configuration File</h1>
<p>Gunciorn 0.5 introduced the ability to use a Python configuration file. Gunicorn will look for <tt class="docutils literal"><span class="pre">gunicorn.conf.py</span></tt> in the current working directory or what ever path is specified on the command line with the <tt class="docutils literal"><span class="pre">-c</span></tt> option.</p>
<p>Gunciorn 0.5 introduced the ability to use a Python configuration file. Gunicorn will look for <tt class="docutils literal">gunicorn.conf.py</tt> in the current working directory or what ever path is specified on the command line with the <tt class="docutils literal"><span class="pre">-c</span></tt> option.</p>
<div class="section" id="example-gunicorn-conf-py">
<h1>Example gunicorn.conf.py</h1>
<pre class="literal-block">
@ -63,6 +63,8 @@ workers = 1 # Number of workers to initialize
umask = 0 # Umask to set when daemonizing
user = None # Change process owner to user
group = None # Change process group to group
proc_name = None # Change the process name
tmp_upload_dir = None # Set path used to store temporary uploads
def after_fork(server, worker):
fmt = &quot;worker=%s spawned pid=%s&quot;
@ -86,23 +88,27 @@ def before_exec(server):
<dt>before_exec(server):</dt>
<dd>This function is called before relaunching the master. This happens when the master receives a HUP or USR2 signal.</dd>
<dt>bind:</dt>
<dd>The address on which workers are listening. It can be a TCP address with a format of <tt class="docutils literal"><span class="pre">IP:PORT</span></tt> or a Unix socket address like <tt class="docutils literal"><span class="pre">unix:/path/to/socketfile</span></tt>.</dd>
<dd>The address on which workers are listening. It can be a TCP address with a format of <tt class="docutils literal">IP:PORT</tt> or a Unix socket address like <tt class="docutils literal"><span class="pre">unix:/path/to/socketfile</span></tt>.</dd>
<dt>daemon:</dt>
<dd>Whether or not to detach the server from the controlling terminal.</dd>
<dt>debug:</dt>
<dd>If <tt class="docutils literal"><span class="pre">True</span></tt>, only one worker will be launch and the variable <tt class="docutils literal"><span class="pre">wsgi.multiprocess</span></tt> will be set to False.</dd>
<dd>If <tt class="docutils literal">True</tt>, only one worker will be launch and the variable <tt class="docutils literal">wsgi.multiprocess</tt> will be set to False.</dd>
<dt>group:</dt>
<dd>The group in which worker processes will be launched.</dd>
<dt>logfile:</dt>
<dd>The path to the log file <tt class="docutils literal"><span class="pre">-</span></tt> (stdout) by default.</dd>
<dd>The path to the log file <tt class="docutils literal">-</tt> (stdout) by default.</dd>
<dt>loglevel:</dt>
<dd>The level at which to log. <tt class="docutils literal"><span class="pre">info</span></tt>, <tt class="docutils literal"><span class="pre">debug</span></tt>, or <tt class="docutils literal"><span class="pre">error</span></tt> for instance. Only log messages of equal or greater severity are logged.</dd>
<dd>The level at which to log. <tt class="docutils literal">info</tt>, <tt class="docutils literal">debug</tt>, or <tt class="docutils literal">error</tt> for instance. Only log messages of equal or greater severity are logged.</dd>
<dt>pidfile:</dt>
<dd>A file to store the master's PID.</dd>
<dt>proc_name:</dt>
<dd>If <a class="reference external" href="http://pypi.python.org/pypi/setproctitle">setproctitle</a> is installed, it allows you to set the process name for this Gunicorn instance.</dd>
<dt>umask:</dt>
<dd>Used to set the umask when daemonizing.</dd>
<dt>user:</dt>
<dd>The user as which worker processes will by launched.</dd>
<dt>tmp_upload_dir:</dt>
<dd>Set the path used to store temporarily the body of the request.</dd>
</dl>
</div>
</div>

View File

@ -50,6 +50,16 @@
<div class="document" id="news">
<h1 class="title">News</h1>
<div class="section" id="id1">
<h1>0.6.2 / 2010-03-01</h1>
<ul class="simple">
<li>Added support for chunked response.</li>
<li>Added possibility to configure proc_name in config file.</li>
<li>Improved HTTP parser. We now use buffers instead of strings to store temporary data.</li>
<li>Improved performance in send.</li>
<li>Workers are now murdered by age (the older is killed the first).</li>
</ul>
</div>
<div class="section" id="id2">
<h1>0.6.1 / 2010-02-24</h1>
<ul class="simple">
<li>Added gunicorn config file support for django admin command</li>
@ -57,21 +67,21 @@
<li>Removed TTIN/TTOU from workers which blocked other signals.</li>
</ul>
</div>
<div class="section" id="id2">
<div class="section" id="id3">
<h1>0.6 / 2010-02-22</h1>
<ul class="simple">
<li>Added setproctitle</li>
<li>Change privilege switch behaviour. We now works like NGINX, master keep the permission, new uid/gid permissions are only set to the workers.</li>
</ul>
</div>
<div class="section" id="id3">
<div class="section" id="id4">
<h1>0.5.1 / 2010-02-22</h1>
<ul class="simple">
<li>Fix umask</li>
<li>Added debian packaging</li>
</ul>
</div>
<div class="section" id="id4">
<div class="section" id="id5">
<h1>0.5 / 2010-02-20</h1>
<ul class="simple">
<li>Added <a class="reference external" href="configuration.html">configuration file</a> handler.</li>

View File

@ -155,8 +155,7 @@ class Request(object):
self.response_status = status
for name, value in response_headers:
name = normalize_name(name)
if name == "Transfer-Encoding":
if name.lower() == "transfer-encoding":
if value.lower() == "chunked":
self.response_chunked = True
if not isinstance(value, basestring):