def _inject_json(r, value, pds, pre_func):
  rs = []
  try:
    x = json.loads(r.content)
  except (__HOLE__, TypeError):
    return rs
  if x.has_key(value):
    n_json = x.copy()
    for p in pds:
      n_json[value] = pre_func(p)
      r_new = r.copy()
      r_new.raw_content = json.dumps(n_json)
      r_new.content = r_new.raw_content
      r_new.injection_point = value
      r_new.payload = p
      r_new.update_content_length()
      rs.append(r_new)
  return rs
dataset/ETHPy150Open securusglobal/abrupt/abrupt/injection.py/_inject_json