Hi, all. I've been having some trouble debugging this vexing issue, and I'm
about at my wits end.
In short: I can *see* POST variables being sent by Firefox, but in my
controller method, request.params is empty. At first when I
started debugging this, I found some reference to paster serve being just
HTTP/1.0, and so went and embedded the application into Apache with mod_wsgi
(which it turned out was a PITA-- yikes!).
At this point, I'm not sure where to even look. I have basically a standard
Pylons setup (0.9.7, Python 2.6, with mod_wsgi via Apache 2.2). The only
"middleware" I have wrapping the default layers is an authorization one,
which is doing this:
--- begin ---
def username_and_password(self, environ):
"""Pull the creds from the form encoded request body."""
# How else can I tell if this is an auth request before reading?
if environ.get('CONTENT_LENGTH'):
clen = int(environ['CONTENT_LENGTH'])
sio = StringIO(environ['wsgi.input'].read(clen))
fs = cgi.FieldStorage(fp=sio,
environ=environ,
keep_blank_values=True)
sio.seek(0)
environ['wsgi.input'] = sio
try:
username = fs[self.user_field].value
password = fs[self.pass_field].value
environ[self.environ_user_key] = username
return username, password
except KeyError:
pass # silence
return '', ''
--- begin ---
Now it does appear to read what would be the POST data, but it also stores
it in wsgi.input after-- which I believe is supposed to preserve it.
Now, I can see a 'token' key being posted in Firefox:
--- begin (from Firebug) ---
Content-Type: multipart/form-data;
boundary=---------------------------178448449274243042114807987
Content-Length: 549
-----------------------------178448449274243042114807987
Content-Disposition: form-data; name="slug"
test1
-----------------------------178448449274243042114807987
Content-Disposition: form-data; name="template"
Word
-----------------------------178448449274243042114807987
Content-Disposition: form-data; name="location"
John Doe
-----------------------------178448449274243042114807987
Content-Disposition: form-data; name="token"
107e6c1cfea33e2110c4017414917617
-----------------------------178448449274243042114807987--
--- end ---
But, in my controller's method that ends up being called --
request.params.keys() is empty.
Anyone have an idea of where I can start looking into this?
Thanks in advance.
--S
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.