| skipped 1123 lines |
1124 | 1124 | | injection_type=injection_type, |
1125 | 1125 | | is_multipart=is_multipart, |
1126 | 1126 | | ) |
1127 | | - | if encode and is_json: |
1128 | | - | payload = urlencode( |
1129 | | - | value=payload, |
1130 | | - | decode_first=True, |
1131 | | - | injection_type=injection_type, |
1132 | | - | is_multipart=is_multipart, |
1133 | | - | ) |
1134 | 1127 | | key_to_split_by = urldecode(key) |
1135 | 1128 | | if ( |
1136 | 1129 | | injection_type in ["GET", "POST", "COOKIE", "HEADER"] |
| skipped 328 lines |
1465 | 1458 | | pass |
1466 | 1459 | | if is_json: |
1467 | 1460 | | params = extract_json_data(data) |
| 1461 | + | if not params: |
| 1462 | + | is_json = False |
1468 | 1463 | | else: |
1469 | 1464 | | MULTIPART_RECOGNITION_REGEX = r"(?i)Content-Disposition:[^;]+;\s*name=" |
1470 | 1465 | | mobj = re.search(MULTIPART_RECOGNITION_REGEX, data) |
| skipped 137 lines |
1608 | 1603 | | if sph and len(sph) == 2: |
1609 | 1604 | | header.update({sph[0].strip(): sph[1].strip()}) |
1610 | 1605 | | if not use_requests: |
1611 | | - | # building headers for build_opener addHeaders |
1612 | | - | # _temp = [] |
1613 | | - | # for key, value in header.items(): |
1614 | | - | # _temp.append((key, value)) |
1615 | | - | # custom_headers = _temp |
1616 | | - | # Request object uses headers in dictionary format.. |
1617 | 1606 | | custom_headers = header |
1618 | 1607 | | else: |
1619 | 1608 | | custom_headers = header |
| skipped 207 lines |