diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/serve.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/serve.js b/lib/serve.js index df2b089..51a7a5d 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -20,7 +20,7 @@ module.exports = Serve var emojiDir = path.join(require.resolve('emoji-named-characters'), '../pngs') var appHash = hash([fs.readFileSync(__filename)]) -var urlIdRegex = /^(?:\/(([%&@]|%25)(?:[A-Za-z0-9\/+]|%2[Ff]|%2[Bb]){43}(?:=|%3D)\.(?:sha256|ed25519))(?:\.([^?]*))?|(\/.*?))(?:\?(.*))?$/ +var urlIdRegex = /^(?:\/+(([%&@]|%25)(?:[A-Za-z0-9\/+]|%2[Ff]|%2[Bb]){43}(?:=|%3D)\.(?:sha256|ed25519))(?:\.([^?]*))?|(\/.*?))(?:\?(.*))?$/ function hash(arr) { return arr.reduce(function (hash, item) { @@ -564,6 +564,7 @@ Serve.prototype.appendFooter = function () { Serve.prototype.wrapPage = function (title, searchQ) { var self = this + var render = self.app.render return pull( catchHTMLError(), self.appendFooter(), @@ -576,10 +577,10 @@ Serve.prototype.wrapPage = function (title, searchQ) { h('style', styles()) ), h('body', - h('nav.nav-bar', h('form', {action: '/search', method: 'get'}, - h('a', {href: '/public'}, 'public'), ' ', - h('a', {href: '/private'}, 'private') , ' ', - self.app.render.idLink(self.app.sbot.id, done()), ' ', + h('nav.nav-bar', h('form', {action: render.toUrl('/search'), method: 'get'}, + h('a', {href: render.toUrl('/public')}, 'public'), ' ', + h('a', {href: render.toUrl('/private')}, 'private') , ' ', + render.idLink(self.app.sbot.id, done()), ' ', h('input.search-input', {name: 'q', value: searchQ, placeholder: 'search', size: 16}) // h('a', {href: '/convos'}, 'convos'), ' ', |