luci-base: ensure that base url is emitted with trailing slash
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 21 Oct 2015 14:45:48 +0000 (16:45 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 21 Oct 2015 14:48:25 +0000 (16:48 +0200)
commit79383f5a74bcff528a5270a930c36b58e310010c
tree75b5f0a4f80bf4015ffcdb201f70f340f39bd48c
parentb4d62d3fd7c7093828c84b5f408cfb0ff6d84939
luci-base: ensure that base url is emitted with trailing slash

Now that we don't have an url token anymore, '/cgi-bin/luci' becomes a valid
url while cookies are restricted to only '/cgi-bin/luci/' and below.

In order to ensure that the first request after login refers to a path
covered by the authentication cookie, change build_url() to always append
a trailing slash if we're referring to the base url.

This should fix the login problems mentioned in #516.

While we're touching the dispatcher, also remove remaining url token code.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
modules/luci-base/luasrc/dispatcher.lua