Hi Joshua,
Thank you, that's a good thought.
Kate sent me some files offline, and I believe we've figured out the
problem. For the middleware to work you must be using WSGI not CGI. Someone
please correct me if I'm wrong, but I believe she would have to upgrade
here App to python27 to use it. The alternative is to do the check in the
webapp request handler:
def check_for_curl(self):
if self.request.environ['HTTP_USER_AGENT'].startswith('curl'):
return self.error(401)
class MainHandler(webapp.RequestHandler):
def get(self):
check_for_curl(self)
# handle request
The problem is that webapp doesn't recognize error code 429 so we have to
use something else. Unless there's a simple way to make it write 429?
- Kyle
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/TQuZYYR0wrAJ.
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/google-appengine?hl=en.