move up content.split, use content[0] on regex.findall
parent
bb0fe7d9dd
commit
394df12bb9
|
@ -22,12 +22,12 @@ class Requester(object):
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
content = content.split('\n')
|
||||||
# Parse method and action URI
|
# Parse method and action URI
|
||||||
regex = re.compile('(.*) (.*) HTTP')
|
regex = re.compile('(.*) (.*) HTTP')
|
||||||
self.method, self.action = regex.findall(content)[0]
|
self.method, self.action = regex.findall(content[0])[0]
|
||||||
|
|
||||||
# Parse headers
|
# Parse headers
|
||||||
content = content.split('\n')
|
|
||||||
for header in content[1:]:
|
for header in content[1:]:
|
||||||
name, _, value = header.partition(': ')
|
name, _, value = header.partition(': ')
|
||||||
if not name or not value:
|
if not name or not value:
|
||||||
|
|
Loading…
Reference in New Issue