Skip to content

Instantly share code, notes, and snippets.

@reuben
Created July 27, 2018 23:16
Show Gist options
  • Save reuben/401d28ef76186709cdbc6cd05b6ed69f to your computer and use it in GitHub Desktop.
Save reuben/401d28ef76186709cdbc6cd05b6ed69f to your computer and use it in GitHub Desktop.
diff --git a/src/jobs.js b/src/jobs.js
index 6ea979e..fbbed59 100644
--- a/src/jobs.js
+++ b/src/jobs.js
@@ -554,7 +554,11 @@ exports.initApp = function(app) {
if (groupsModule.canAccessJob(req.user, dbjob)) {
let jobdir = _getJobDir(dbjob)
res.status(200).type('tar.gz')
- tar.pack(jobdir).pipe(zlib.createGzip()).pipe(res)
+ tar.pack(jobdir, {
+ map: function(header) {
+ res.set('Content-Length', header.size)
+ },
+ }).pipe(zlib.createGzip()).pipe(res)
} else {
res.status(403).send()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment