Skip to content

Commit 93de65a

Browse files
committed
flake8 fixes to common.py
1 parent da71b8e commit 93de65a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/common.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,10 +1953,10 @@ def send_head(self):
19531953
self.send_header('Content-Type', ctype)
19541954
pieces = self.headers.get("Range").split("=")[1].split("-")
19551955
start = int(pieces[0]) if pieces[0] != '' else 0
1956-
end = int(pieces[1]) if pieces[1] != '' else fs[6]-1
1956+
end = int(pieces[1]) if pieces[1] != '' else fs[6] - 1
19571957
end = min(fs[6] - 1, end)
19581958
length = end - start + 1
1959-
self.send_header('Content-Range', "bytes "+str(start)+"-"+str(end)+"/"+str(fs[6]));
1959+
self.send_header('Content-Range', "bytes " + str(start) + "-" + str(end) + "/" + str(fs[6]))
19601960
self.send_header('Content-Length', str(length))
19611961
self.end_headers()
19621962
return f
@@ -2065,20 +2065,19 @@ def do_GET(self):
20652065
path = self.translate_path(self.path)
20662066
data = read_binary(path)
20672067
ctype = self.guess_type(path)
2068-
self.send_header('Content-type', 'text/html')
2068+
self.send_header('Content-type', ctype)
20692069
pieces = self.headers.get("range").split("=")[1].split("-")
20702070
start = int(pieces[0]) if pieces[0] != '' else 0
2071-
end = int(pieces[1]) if pieces[1] != '' else len(data)-1
2071+
end = int(pieces[1]) if pieces[1] != '' else len(data) - 1
20722072
end = min(len(data) - 1, end)
20732073
length = end - start + 1
20742074
self.send_header('Content-Length', str(length))
2075-
self.send_header('Content-Range', "bytes "+str(start)+"-"+str(end)+"/"+str(len(data)));
2075+
self.send_header('Content-Range', "bytes " + str(start) + "-" + str(end) + "/" + str(len(data)))
20762076
self.end_headers()
20772077
self.wfile.write(data[start:end + 1])
20782078
else:
20792079
SimpleHTTPRequestHandler.do_GET(self)
20802080

2081-
20822081
def log_request(code=0, size=0):
20832082
# don't log; too noisy
20842083
pass

0 commit comments

Comments
 (0)