aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-19 10:55:05 -0500
committercel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519>2017-02-19 10:55:05 -0500
commitb6e8e9f344a9029560e4b762f4f0fa737f78a514 (patch)
tree41b58ef924e80d9e7370130107d545f39bf57e6e
parentb1e230d4b884ddea8cb20893b9e16f7b3a881336 (diff)
downloadpatchfoo-b6e8e9f344a9029560e4b762f4f0fa737f78a514.tar.gz
patchfoo-b6e8e9f344a9029560e4b762f4f0fa737f78a514.zip
Allow changing content-type of attachment
-rw-r--r--lib/serve.js7
1 files changed, 6 insertions, 1 deletions
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()) :