Sanitize builder server protocol uri

The lift-json project couldn't load in the community build because the
generated uri contained two # identifiers.
This commit is contained in:
Ethan Atkins 2020-09-02 15:27:52 -07:00
parent debc9a28a4
commit 443ebcd3d7
1 changed files with 5 additions and 1 deletions

View File

@ -368,7 +368,11 @@ object BuildServerProtocol {
private def toId(ref: ProjectReference, config: Configuration): BuildTargetIdentifier =
ref match {
case ProjectRef(build, project) =>
BuildTargetIdentifier(new URI(s"$build#$project/${config.id}"))
val sanitized = build.toString.indexOf("#") match {
case i if i > 0 => build.toString.take(i)
case _ => build.toString
}
BuildTargetIdentifier(new URI(s"$sanitized#$project/${config.id}"))
case _ => sys.error(s"unexpected $ref")
}