Fix bug in None->null conversion for static strings. (#307)

- First, None needs to be checked and then the string should be quoted.
- null values should not be quoted
This commit is contained in:
marina-p 2021-08-24 17:35:58 -07:00 коммит произвёл GitHub
Родитель e0053e7287
Коммит 39b3ea87ab
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -681,12 +681,14 @@ class Request(object):
# Handle static whose value is the field name
elif primitive_type == primitives.STATIC_STRING:
val = default_val
if quoted:
val = f'"{val}"'
if val == None:
# the examplesChecker may inject None/null, so replace these with the string 'null'
logger.raw_network_logging(f"Warning: there is a None value in a STATIC_STRING.")
val = 'null'
# Do not quote null values.
quoted = False
if quoted:
val = f'"{val}"'
values = [val]
# Handle multipart form data
elif primitive_type == primitives.FUZZABLE_MULTIPART_FORMDATA: