git ssb

30+

cel / git-ssb-web



Commit 66b481587732c7cd87a4574e9fb77e4b917832df

Simplify serveRaw

Charles Lehner committed on 4/15/2016, 6:13:23 PM
Parent: ebbef91f252638540e837f6a111d16e0c503983b

Files changed

index.jschanged
index.jsView
@@ -1904,22 +1904,16 @@
19041904 })
19051905 }
19061906
19071907 function serveRaw(length, contentType) {
1908- var inBody
19091908 var headers = {
19101909 'Content-Type': contentType || 'text/plain; charset=utf-8',
19111910 'Cache-Control': 'max-age=31536000'
19121911 }
19131912 if (length != null)
19141913 headers['Content-Length'] = length
19151914 return function (read) {
1916- return function (end, cb) {
1917- if (inBody) return read(end, cb)
1918- if (end) return cb(true)
1919- cb(null, [200, headers])
1920- inBody = true
1921- }
1915+ return cat([pull.once([200, headers]), read])
19221916 }
19231917 }
19241918
19251919 function getBlob(req, key, cb) {

Built with git-ssb-web