file function but found a head bug
This commit is contained in:
11
mswp.py
11
mswp.py
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user