Пример #1
0
def test():
  response = flask.make_response(flask.render_template(
      'aws/debug.html',
      title='Test',
      agent=util.user_agent(),
      timestamp=datetime.utcnow(),
      get_url=util.get_url(),
      host=flask.request.host,
      country=util.geoip_country(),
      ip=flask.request.headers.get('X-Forwarded-For') or flask.request.remote_addr,
    ))
  return response
Пример #2
0
def test():
  response = flask.make_response(flask.render_template(
      'aws/debug.html',
      title='Test',
      agent=util.user_agent(),
      timestamp=datetime.utcnow(),
      get_url=util.get_url(),
      host=flask.request.host,
      country=util.geoip_country(),
      ip=flask.request.headers.get('X-Forwarded-For') or flask.request.remote_addr,
    ))
  return response
Пример #3
0
 def decorated_function(*args, **kwargs):
     p = flask.request.path
     browser_check = p.endswith('/') or p.endswith('.html')
     browser_check = browser_check and not p.startswith('/test/')
     if browser_check:
         try:
             agent = util.user_agent()
             if agent['is']['mobile']:
                 return flask.abort(406)
             if not util.check_browser(agent):
                 return flask.abort(406)
         except KeyError:
             return flask.abort(406)
     return f(*args, **kwargs)
Пример #4
0
 def decorated_function(*args, **kwargs):
   p = flask.request.path
   browser_check = p.endswith('/') or p.endswith('.html')
   browser_check = browser_check and not p.startswith('/test/')
   if browser_check:
     try:
       agent = util.user_agent()
       if agent['is']['mobile']:
         return flask.abort(406)
       if not util.check_browser(agent):
         return flask.abort(406)
     except KeyError:
       return flask.abort(406)
   return f(*args, **kwargs)
Пример #5
0
def browser_test():
    return flask.jsonify(util.user_agent())
Пример #6
0
def test_agent():
    return flask.jsonify(util.user_agent())
Пример #7
0
def test_agent():
  return flask.jsonify(util.user_agent())
Пример #8
0
def browser_test():
  return flask.jsonify(util.user_agent())