Kate,

You could check the user agent in a middleware something like this:

# in your appengine_config.py file - root directory
from webob import Response

class AntiCurlMiddleware(object):
    def __init__(self, app):
        self.app = app

    def __call__(self, environ, start_response):
        if environ['HTTP_USER_AGENT'] is 'curl':
            resp = Response('Too many requests!')
            resp.status_code = 423
            return resp(environ, start_response)
        return self.app(environ, start_response)

def webapp_add_wsgi_middleware(app):
    return AntiCurlMiddlewarey(app)

I haven't tested this, so If anyone sees any errors please let me know.

- 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/-/DzxbRxBudNMJ.
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.

Reply via email to