We have fixed the API requests for a job's log (
The API now respects the
Accept header, and responds to
with correctly formatted data.
In addition, the API no longer considers
User-Agent header in the request.
Previously, the API responded with
text/plain data when the request was for
User-Agent started with the string
Travis. This is no longer the case; such a request
now receives the JSON representation of the logs, as shown below.
$ curl -H "Accept: application/json" -sSfL https://api.travis-ci.org/jobs/550336933/log | jq .
"body": "travis_fold:start:worker_info\r\u001b[0K\u001b[33;1mWorker information…"
$ curl -H "Accept: text/plain" -sSfL https://api.travis-ci.org/jobs/550336933/log
As a side effect, the
travis logs command is now fixed. https://github.com/travis-ci/travis.rb/issues/578
$ travis logs
displaying logs for BanzaiMan/travis_production_test#5226.1
version: v6.2.8 https://github.com/travis-ci/worker/tree/6d3048d96b26562be21fa1a8b8144f4c4cecd083
Done. Your build exited with 0.