private def getHttp = Http()

in app/services/GithubAPI.scala [29:48]


  private def getHttp = Http()

  val githubOrgName = config.getOptional[String]("github.orgname")
  val githubToken = config.getOptional[String]("github.token")

  val defaultGithubHeaders = Accept(MediaRange(MediaType.customWithFixedCharset("application","vnd.github.v3+json",HttpCharsets.`UTF-8`)))

  private def makeRequest(section:String, subpath:String) = {
    githubOrgName match {
      case Some(org)=>
        val uriString = s"https://api.github.com/$section/$org/$subpath"
        val actualHeaders = Seq(Some(defaultGithubHeaders), githubToken.map(t=>Authorization(GenericHttpCredentials("token", t)))).collect({case Some(h)=>h})
        logger.debug(s"Github API request is $uriString")
          HttpRequest(
          uri = uriString,
          headers = actualHeaders
        )
      case None=>throw new RuntimeException("Github integration is not configured. Please set `github.orgname` in the app config")
    }
  }