file function but found a head bug

This commit is contained in:
2019-12-16 21:13:32 +08:00
parent b94ee87ef1
commit 2dffadca8c
3 changed files with 54 additions and 55 deletions

11
mswp.py
View File

@@ -1,6 +1,3 @@
from config import jsondata
class Datapack:
def __init__(self, method='post', app='all', version='msw/1.0', head={}, body=b'', check_head=True):
self.method = method
@@ -22,6 +19,7 @@ class Datapack:
self.encode_data = first_line + b'\n' + heads + b'\n' + self.body
def decode(self, only_head=False):
self.head = {}
index = self.encode_data.index(b'\n\n')
upper = self.encode_data[:index]
if not only_head:
@@ -37,10 +35,3 @@ class Datapack:
self.head[i] = ii
if only_head:
return self.encode_data[index+2:]
def split_dp_data(data):
pass