summaryrefslogtreecommitdiffstats
path: root/module/network
diff options
context:
space:
mode:
Diffstat (limited to 'module/network')
-rw-r--r--module/network/HTTPChunk.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py
index 1cc9841a6..07012d072 100644
--- a/module/network/HTTPChunk.py
+++ b/module/network/HTTPChunk.py
@@ -128,6 +128,9 @@ class HTTPChunk(HTTPRequest):
self.initHandle()
self.setInterface(self.p.interface, self.p.proxies)
+ self.BOMChecked = False
+ # check and remove byte order mark
+
@property
def cj(self):
return self.p.cj
@@ -174,6 +177,14 @@ class HTTPChunk(HTTPRequest):
self.headerParsed = True
def writeBody(self, buf):
+
+ #ignore BOM, it confuses unrar
+ if not self.BOMChecked:
+ byte = bytearray(buf[:3])
+ if tuple(byte) == (239,187,191):
+ buf = buf[3:]
+ self.BOMChecked = True
+
size = len(buf)
self.arrived += size