report.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:python-ares 作者: pynog 项目源码 文件源码
def getHttpParams(request):
  """
  Get the HTTP parameters of a request

  All the results will be done in upper case, just to make sure that users will be used to define
  those variable in uppercases
  """
  httpParams = {}
  for postValues in request.args.items():
    #TODO Find a way to not have this stupid hack
    httpParams[postValues[0].replace("amp;", "")] = postValues[1]
  for postValues in request.form.items():
    httpParams[postValues[0]] = postValues[1]
  httpParams['DIRECTORY'] = os.path.join(current_app.config['ROOT_PATH'], config.ARES_USERS_LOCATION)
  # Special environment configuration
  httpParams['CONFIG'] = {}
  httpParams['CONFIG']['WRK'] = config.WORK_PATH
  httpParams['CONFIG']['COMPANY'] = config.COMPANY
  for source in AUTHORIZED_SOURCES:
    httpParams[source] = session.get(source, None)
  return httpParams
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号