mirror of
https://github.com/sbt/sbt.git
synced 2026-09-01 02:27:13 +02:00
Dummy fix in release process
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user