Hi all,
this is my first post here so allow me to give my compliments to Mr. Di 
Pierro and all the people that works on this wonderful project.
I do not have a big experience in web programming, i came from "offline" :) 
programming and triyng to add value to the products of my software house 
with online capabilities
so i'm in "learning mode" (about 1 month now) with python uwsgi nginx and 
all the web stuff in general

i have implemented a nginx+uwsgi_emperor+web2py multisite solution on a new 
server that will serve (in future) different sites and services for our 
company and customers. (it works great for now :)

i'm a little worried about a sentence in this page:
http://projects.unbit.it/uwsgi/wiki/ThingsToKnow

I do not understand this paragraph:
"If an http request has a body (like a POST request generated by a form) 
you have to read it in the application."
[...] "If you do not do it, the communication socket with your webserver 
could be clobbered."

i want to implement a lot of restful calls in many parts of my sites and 
i'm ok reading the body of a legit request
but i don't know how to handle NON legit requests...
do i need to read the body in any case??

suppose i want to check a POST request in code and discard the request 
raising HTTP(500) if i do not like the user-agent (is only an example):

def call():
    session.forget()
    if request.env.http_user_agent == "NonGoodBrowser":
        raise HTTP(500)
    return service()

also if a browser send me a lot of wrong POST requests with null-filled 
bodies to every page of my site, do i need to read it all and use server 
resources?

suppose i don't want to activate the --post-buffering option for the same 
reason of server resources drain.

what you suggest me?

thanks in advance,
Giovanni V.

-- 



Reply via email to