aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/serve.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 4b9eb1b..e50caa8 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -2671,6 +2671,8 @@ Serve.prototype.web = function (url) {
components[0] = decodeURIComponent(components[0])
var type = mime.lookup(components[components.length - 1])
+ var headers = {}
+ if (type) headers['Content-Type'] = type
webresolve(this.app.sbot, components, function (err, res) {
if (err) {
return pull(
@@ -2678,9 +2680,10 @@ Serve.prototype.web = function (url) {
self.respondSink(404)
)
}
+ headers['Content-Length'] = res.length
return pull(
pull.once(res),
- self.respondSink(200, {'content-type': type, 'content-length': res.length})
+ self.respondSink(200, headers)
)
})
}