From 9cdce1f0fa8e7969eb1ab545e716b4630ae1ec68 Mon Sep 17 00:00:00 2001 From: noffle Date: Thu, 19 Apr 2018 15:30:45 -0700 Subject: fix: web mime type and length --- lib/serve.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/serve.js b/lib/serve.js index ef7825d..a68d815 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -2662,6 +2662,7 @@ Serve.prototype.web = function (url) { if (components[0] === '') components.shift() components[0] = decodeURIComponent(components[0]) + var type = mime.lookup(components[components.length - 1]) webresolve(this.app.sbot, components, function (err, res) { if (err) { return pull( @@ -2669,10 +2670,9 @@ Serve.prototype.web = function (url) { self.respondSink(404) ) } - return pull( pull.once(res), - self.respondSink(200) + self.respondSink(200, {'content-type': type, 'content-length': res.length}) ) }) } -- cgit v1.2.3