From b6e8e9f344a9029560e4b762f4f0fa737f78a514 Mon Sep 17 00:00:00 2001 From: cel Date: Sun, 19 Feb 2017 10:55:05 -0500 Subject: Allow changing content-type of attachment --- lib/serve.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/serve.js b/lib/serve.js index 8e563fb..f8d9cf1 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -816,6 +816,9 @@ Serve.prototype.composer = function (opts, cb) { size: data.upload.size, } } + if (data.blob_type && blobs[data.blob_link]) { + blobs[data.blob_link].type = data.blob_type + } var done = multicb({pluck: 1, spread: true}) done()(null, h('section.composer', @@ -850,7 +853,9 @@ Serve.prototype.composer = function (opts, cb) { ), data.upload ? [ h('div', h('em', 'attach:')), - h('pre', '[' + data.upload.name + '](' + data.upload.link + ')') + h('code', '[' + data.upload.name + '](' + data.upload.link + ')'), ' ', + h('input', {name: 'blob_link', value: data.upload.link, type: 'hidden'}), + h('input', {name: 'blob_type', value: data.upload.type}) ] : '', data.action === 'preview' ? preview(false, done()) : data.action === 'raw' ? preview(true, done()) : -- cgit v1.2.3