Fix fetching log in firefox when Location header is unavailable
This commit is contained in:
parent
46413b66fb
commit
7996358f01
|
@ -64,7 +64,7 @@ Travis.Log.Request = Em.Object.extend
|
|||
endpoint = Travis.config.api_endpoint
|
||||
staging = if endpoint.match(/-staging/) then '-staging' else ''
|
||||
host = endpoint.replace(/^https?:\/\//, '').split('.').slice(-2).join('.')
|
||||
"https://s3.amazonaws.com/archive#{staging}.#{host}#{path}/jobs/#{@id}/log.txt"
|
||||
"https://s3.amazonaws.com/archive#{staging}.#{host}/jobs/#{@get('id')}/log.txt"
|
||||
|
||||
isJson: (xhr, body) ->
|
||||
# Firefox can't see the Content-Type header on the xhr response due to the wrong
|
||||
|
|
6
assets/scripts/spec/unit/log_request_spec.coffee
Normal file
6
assets/scripts/spec/unit/log_request_spec.coffee
Normal file
|
@ -0,0 +1,6 @@
|
|||
describe 'Travis.Log.Request', ->
|
||||
it 'constructs s3 url for log', ->
|
||||
Travis.config.api_endpoint = 'api.travis-ci.org'
|
||||
request = Travis.Log.Request.create(id: 10)
|
||||
s3Url = "https://s3.amazonaws.com/archive.travis-ci.org/jobs/10/log.txt"
|
||||
expect( request.s3Url() ).toEqual(s3Url)
|
Loading…
Reference in New Issue
Block a user