aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-05-06 11:43:54 -0400
committercel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519>2020-05-06 11:43:54 -0400
commita61279f373c90d3fdfcab9b1452ea274699b2289 (patch)
treef229b0b6ce0463550504082ea17e13513ecacd63
parent926edce4bb7ca2b938d359de8a059f64f4f3ed70 (diff)
downloadpatchfoo-a61279f373c90d3fdfcab9b1452ea274699b2289.tar.gz
patchfoo-a61279f373c90d3fdfcab9b1452ea274699b2289.zip
Handle want private blobs for markdown view
-rw-r--r--lib/serve.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 414cef5..7d686a4 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -382,10 +382,15 @@ Serve.prototype.publishAttend = function (cb) {
this.publish(content, cb)
}
+function removeQuery(ref) {
+ return ref.replace(/\?.*/, '')
+}
+
Serve.prototype.wantBlobs = function (cb) {
var self = this
if (!self.data.blob_ids) return cb()
var ids = self.data.blob_ids.split(',')
+ .map(removeQuery)
if (!ids.every(u.isRef)) return cb(new Error('bad blob ids ' + ids.join(',')))
var done = multicb({pluck: 1})
ids.forEach(function (id) {
@@ -4031,7 +4036,8 @@ Serve.prototype.askWantBlobsForm = function (links) {
ph('h3', 'Missing blobs'),
ph('p', 'The application needs these blobs to continue:'),
ph('table', links.map(u.toLink).filter(uniqueLink()).map(function (link) {
- if (!u.isRef(link.link)) return
+ var id = removeQuery(link.link)
+ if (!u.isRef(id)) return
return ph('tr', [
ph('td', ph('code', link.link)),
!isNaN(link.size) ? ph('td', self.app.render.formatSize(link.size)) : '',