do not wtv-checksum on 0 byte content
This commit is contained in:
@@ -586,7 +586,7 @@ async function sendToClient(socket, headers_obj, data) {
|
|||||||
if (content_length >= 256) compression_type = wtvmime.shouldWeCompress(ssid_sessions[socket.ssid], headers_obj);
|
if (content_length >= 256) compression_type = wtvmime.shouldWeCompress(ssid_sessions[socket.ssid], headers_obj);
|
||||||
|
|
||||||
// disk service hack before further processing :)
|
// disk service hack before further processing :)
|
||||||
if (socket_sessions[socket.id].wtv_request_type == "download") {
|
if (socket_sessions[socket.id].wtv_request_type == "download" && content_length < 0) {
|
||||||
if (headers_obj['Content-Type'] == "application/gzip") {
|
if (headers_obj['Content-Type'] == "application/gzip") {
|
||||||
var gunzipped = zlib.gunzipSync(data);
|
var gunzipped = zlib.gunzipSync(data);
|
||||||
headers_obj['wtv-checksum'] = CryptoJS.MD5(CryptoJS.lib.WordArray.create(gunzipped)).toString(CryptoJS.enc.Hex).toLowerCase();
|
headers_obj['wtv-checksum'] = CryptoJS.MD5(CryptoJS.lib.WordArray.create(gunzipped)).toString(CryptoJS.enc.Hex).toLowerCase();
|
||||||
|
|||||||
Reference in New Issue
Block a user