198 if k.startswith('HTTP_'): |
198 if k.startswith('HTTP_'): |
199 headers.append((k[len('HTTP_'):].replace('_', '-'), v)) |
199 headers.append((k[len('HTTP_'):].replace('_', '-'), v)) |
200 |
200 |
201 headers = wsgiheaders.Headers(headers) |
201 headers = wsgiheaders.Headers(headers) |
202 |
202 |
|
203 # This is kind of a lie because the HTTP header wasn't explicitly |
|
204 # sent. But for all intents and purposes it should be OK to lie about |
|
205 # this, since a consumer will either either value to determine how many |
|
206 # bytes are available to read. |
|
207 if 'CONTENT_LENGTH' in env and 'HTTP_CONTENT_LENGTH' not in env: |
|
208 headers['Content-Length'] = env['CONTENT_LENGTH'] |
|
209 |
203 return parsedrequest(url=fullurl, baseurl=baseurl, |
210 return parsedrequest(url=fullurl, baseurl=baseurl, |
204 advertisedurl=advertisedfullurl, |
211 advertisedurl=advertisedfullurl, |
205 advertisedbaseurl=advertisedbaseurl, |
212 advertisedbaseurl=advertisedbaseurl, |
206 apppath=apppath, |
213 apppath=apppath, |
207 dispatchparts=dispatchparts, dispatchpath=dispatchpath, |
214 dispatchparts=dispatchparts, dispatchpath=dispatchpath, |