def create_default_options(allowed_methods):
 allowed = ', '.join(allowed_methods)
 def on_options(req, resp, **kwargs):
  resp.status = HTTP_204
  resp.set_header('Allow', allowed)
  resp.set_header('Content-Length', '0')
 return on_options

def create_default_options ( allowed_methods ) : allowed = ', ' . join ( allowed_methods ) def on_options ( req , resp , ** kwargs ) : resp . status = HTTP_204 resp . set_header ( 'Allow' , allowed ) resp . set_header ( 'Content-Length' , '0' ) return on_options
creates a default responder for the options method args: allowed_methods: a list of http methods that should be returned in the allow header .