🐛 Add X-Original-Content-Length to file downloads (#4775)
Avoids issues with chunked transfers that remove the "Content-Length" header, which the GCODE viewer requires for calculating percentages for progress monitoring. Closes #4772
This commit is contained in:
1 parent
c1c1cccc56
commit
a4b0d340a7
2 files changed
+3
-1
No files matched your search
@@ -353,7 +353,7 @@ var gCodeLineGenerator = async function* (fileURL) {
|
||||
const reader = response.body.getReader();
|
||||
|
||||
// we use these two variables to calculate the percentage.
|
||||
var totalDownloadLength = response.headers.get("content-length");
|
||||
var totalDownloadLength = response.headers.get("X-Original-Content-Length");
|
||||
var currentDownloadLength = 0;
|
||||
|
||||
// lets read a first data chunk
|
||||
|
||||
@@ -1192,6 +1192,8 @@ class LargeResponseHandler(
|
||||
self.set_header("Cache-Control", "max-age=0, must-revalidate, private")
|
||||
self.set_header("Expires", "-1")
|
||||
|
||||
self.set_header("X-Original-Content-Length", str(self.get_content_size()))
|
||||
|
||||
@property
|
||||
def original_absolute_path(self):
|
||||
"""The path of the uncompressed file corresponding to the compressed file"""
|
||||
|
||||
Reference in new issue
Block a user