Backport #8701, do not append a second slash with `trailing_slash: true`
Merge pull request #8703 from senny/backport_8700

Backport #8701, do not append a second slash with `trailing_slash: true`

Closes #8700