Render baseurl without trailing slash

The webapp expects it like this currently, because the url is only a
string.
This commit is contained in:
Eike Kettner
2021-01-21 21:42:08 +01:00
parent b9b554980a
commit 0ec620fcf0
2 changed files with 8 additions and 2 deletions

View File

@ -49,6 +49,12 @@ case class LenientUri(
def withFragment(f: String): LenientUri =
copy(fragment = Some(f))
def rootPathToEmpty: LenientUri =
path match {
case LenientUri.RootPath => copy(path = LenientUri.EmptyPath)
case _ => this
}
def toJavaUrl: Either[String, URL] =
Either.catchNonFatal(new URL(asString)).left.map(_.getMessage)