<commit_before>config = ENV.config

Adapter = DS.ActiveModelAdapter.extend
  host: config.api_endpoint

  ajaxOptions: (url, type, options) ->
    hash = @_super(url, type, options)

    hash.headers ||= {}

    hash.headers['accept'] = 'application/json; version=2'

    token = Travis.sessionStorage.getItem('travis.token')
    hash.headers['Authorization'] ||= "token #{token}"

    hash


Travis.ApplicationAdapter = Adapter<commit_msg>Don't send Authorization header if we don't have token<commit_after>config = ENV.config

Adapter = DS.ActiveModelAdapter.extend
  host: config.api_endpoint

  ajaxOptions: (url, type, options) ->
    hash = @_super(url, type, options)

    hash.headers ||= {}

    hash.headers['accept'] = 'application/json; version=2'

    if token = Travis.sessionStorage.getItem('travis.token')
      hash.headers['Authorization'] ||= "token #{token}"

    hash


Travis.ApplicationAdapter = Adapter
{'fraction_non_alphanumeric': 0.13822894168466524, 'fraction_numerical': 0.0021598272138228943, 'mean_word_length': 4.15, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6430807', 'n_tokens_mistral': 293, 'n_tokens_neox': 282, 'n_words': 60}