Commit ebbef91f252638540e837f6a111d16e0c503983b
Fix serving blobs
Charles Lehner committed on 4/15/2016, 6:13:13 PMParent: c41b8297c7ac5978b6a4bc7b4115c2302c128e6e
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -1930,12 +1930,14 @@ | ||
1930 | 1930 | }) |
1931 | 1931 | } |
1932 | 1932 | |
1933 | 1933 | function serveBlob(req, key) { |
1934 | - getBlob(req, key, function (err, read) { | |
1935 | - if (err) cb(null, serveError(req, err)) | |
1936 | - else if (!got) cb(null, serve404(req)) | |
1937 | - else cb(null, serveRaw()(read)) | |
1934 | + return readNext(function (cb) { | |
1935 | + getBlob(req, key, function (err, read) { | |
1936 | + if (err) cb(null, serveError(req, err)) | |
1937 | + else if (!read) cb(null, serve404(req)) | |
1938 | + else cb(null, serveRaw()(read)) | |
1939 | + }) | |
1938 | 1940 | }) |
1939 | 1941 | } |
1940 | 1942 | |
1941 | 1943 | /* Digs */ |
Built with git-ssb-web