Dummy fix in release process

This commit is contained in:
Alexandre Archambault 2017-05-15 15:32:52 +02:00
parent 72fa824f36
commit a0bc58afa3
2 changed files with 8 additions and 4 deletions

View File

@ -21,7 +21,7 @@ object HttpUtil {
buffer.toByteArray
}
def fetch(url: String, log: Logger): String = {
def fetch(url: String, log: Logger, extraHeaders: Seq[(String, String)] = Nil): String = {
val url0 = new URL(url)
@ -36,7 +36,8 @@ object HttpUtil {
try {
conn = url0.openConnection()
httpConn = conn.asInstanceOf[HttpURLConnection]
httpConn.setRequestProperty("Accept", "application/vnd.travis-ci.2+json")
for ((k, v) <- extraHeaders)
httpConn.setRequestProperty(k, v)
is = conn.getInputStream
(readFully(is), httpConn.getResponseCode)

View File

@ -51,11 +51,14 @@ object Travis {
job: JobDetails
)
val extraHeaders = Seq(
"Accept" -> "application/vnd.travis-ci.2+json"
)
def builds(repo: String, log: Logger): List[Build] = {
val url = s"https://api.travis-ci.org/repos/$repo/builds"
val resp = HttpUtil.fetch(url, log)
val resp = HttpUtil.fetch(url, log, extraHeaders)
resp.decodeEither[Builds] match {
case Left(err) =>
@ -69,7 +72,7 @@ object Travis {
def job(id: JobId, log: Logger): Job = {
val url = s"https://api.travis-ci.org/jobs/${id.value}"
val resp = HttpUtil.fetch(url, log)
val resp = HttpUtil.fetch(url, log, extraHeaders)
resp.decodeEither[Job] match {
case Left(err) =>