fix
This commit is contained in:
parent
623f63c18c
commit
fa005f6366
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
|
.idea
|
||||||
|
.idea/**
|
||||||
local.env
|
local.env
|
||||||
**/*.pyc
|
**/*.pyc
|
||||||
test/
|
test/
|
||||||
|
@ -48,7 +48,7 @@ class RequireJSON:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if req.method in ('POST', 'PUT'):
|
if req.method in ('POST', 'PUT'):
|
||||||
if req.content_type == None or 'application/json' not in req.content_type:
|
if req.content_type is None or 'application/json' not in req.content_type:
|
||||||
raise falcon.HTTPUnsupportedMediaType(
|
raise falcon.HTTPUnsupportedMediaType(
|
||||||
title='This API only supports requests encoded as JSON.',
|
title='This API only supports requests encoded as JSON.',
|
||||||
href='http://docs.examples.com/api/json',
|
href='http://docs.examples.com/api/json',
|
||||||
@ -158,7 +158,7 @@ class CreateTaskResource:
|
|||||||
is_waiting_empty_line = False
|
is_waiting_empty_line = False
|
||||||
with open(file_path, 'r', encoding='UTF-8') as file:
|
with open(file_path, 'r', encoding='UTF-8') as file:
|
||||||
while line := file.readline():
|
while line := file.readline():
|
||||||
if section_found == False:
|
if not section_found:
|
||||||
if line.strip() == CreateTaskResource.TODO_HEADER:
|
if line.strip() == CreateTaskResource.TODO_HEADER:
|
||||||
section_found = True
|
section_found = True
|
||||||
is_waiting_empty_line = True
|
is_waiting_empty_line = True
|
||||||
|
Loading…
Reference in New Issue
Block a user