diff options
Diffstat (limited to 'lib/serve.js')
-rw-r--r-- | lib/serve.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/serve.js b/lib/serve.js index d0a9624..34861bc 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -26,6 +26,7 @@ var Diff = require('diff') var split = require('pull-split') var utf8 = require('pull-utf8-decoder') var webresolve = require('ssb-web-resolver') +var Url = require('url') module.exports = Serve @@ -181,8 +182,10 @@ Serve.prototype.go = function () { if (self.data.redirect_to_published_msg) { self.redirect(self.app.render.toUrl(publishedMsg.key)) } else { - self.publishedMsg = publishedMsg - self.handle() + var u = Url.parse(self.req.url) + var q = u.query || (u.query = {}) + q.published = publishedMsg.key + self.redirect(Url.format(u)) } } else { self.handle() @@ -1800,9 +1803,9 @@ Serve.prototype.wrapPage = function (title, searchQ) { ] }) )), - self.publishedMsg ? h('div', + self.query.published ? h('div', 'published ', - self.app.render.msgLink(self.publishedMsg, done()) + render.msgIdLink(self.query.published, done()) ) : '', // self.note, content |