Include site root in e-mail URLs once
Review Request #9448 — Created Dec. 18, 2017 and submitted — Latest diff uploaded
The refactoring of e-mails in Review Board 3.0 ended up causing a
regression where URLs in e-mails would have the site root applied twice.
For example, for a server hosted athttp://example.com/rb
, the URL for
a review request would be generated ashttp://example.com/rb/rb/r/1
.
This was due to no longer computing the site URL (which was the scheme +
domain only), but instead using the result ofget_server_url()
which
includes the site root. This regression wasn't apparent due to a lack of
testing on configurations where the site root was anything other than
/
.Now, we pass in the correct value for
site_url
, computing it from
build_server_url
for the/
URL (which clobbers the site root) and
stripping the trailing/
(so we don't get double/
in URLs).
Previewed e-mails on a server where the site root was not
/
and saw
that the generated URLs were correct.Ran unit tests.