[issue2551047] REST-API not working with wsgi
Ralf Schlatterbeck <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.devel |
|---|---|
| Message-ID | <[email protected]> |
New submission from Ralf Schlatterbeck:
The rest implementation uses several calls to client.request.headers.
In WSGI 'request' is a RequestDispatcher object from
roundup/cgi/wsgi_handler.py
This object doesn't have a 'headers' attribute.
My naive implementation of a headers object would be to take the header
name, convert it to uppercase and replace '-' with '_', prefix it with
HTTP_ and look it up in the CGI environment. Is this an acceptable
solution? Alternatives, better ideas?
I found a google groups article that goes into the same direction:
https://groups.google.com/forum/#!topic/modwsgi/swJmEP79Pds
Traceback when calling rest uri with WSGI:
Traceback (most recent call last):
File
"/usr/local/lib/python2.7/dist-packages/roundup/cgi/wsgi_handler.py",
line 74, in __call__
client.main()
File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/client.py",
line 471, in main
self.handle_rest()
File "/usr/local/lib/python2.7/dist-packages/roundup/cgi/client.py",
line 572, in handle_rest
self.path, self.form)
File "/usr/local/lib/python2.7/dist-packages/roundup/rest.py", line
1723, in dispatch
headers = self.client.request.headers
AttributeError: 'RequestDispatcher' object has no attribute 'headers'
----------
components: API
messages: 6551
nosy: rouilj, schlatterbeck
severity: normal
status: new
title: REST-API not working with wsgi
versions: 2.0.0alpha
_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551047>
_________________________________________________