Skip to content

Commit

Permalink
fixed issue pedosb#5, implemented issue pedosb#8
Browse files Browse the repository at this point in the history
  • Loading branch information
itelo committed Apr 29, 2015
1 parent 72beb43 commit f4933d3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions webnote.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import re
import json
import urlparse
import urllib

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
Expand Down Expand Up @@ -43,7 +42,7 @@
if field is not None:
field_name = field.group(1)
field_body = field.group(2)
request_headers[field_name] = field_body
request_headers[field_name.lower()] = field_body
data = field.group(3)
else:
raise Exception('Cannot read request header')
Expand Down Expand Up @@ -85,7 +84,7 @@
"""
elif method == 'POST':
while True:
if len(data) != request_headers['Content-Lenght']:
if len(data) != int (request_headers['content-length']):
data += conn.recv(1024)
else:
break
Expand Down

0 comments on commit f4933d3

Please sign in to comment.