<commit_before>module AlternateRails
  module ControllerHelpers

    def alternate_formats(formats)
      @alternate_formats = formats
      send_headers
    end
    
    def send_headers
      if params[:format].nil? && request.headers['action_dispatch.request.accepts']
        format = request.format
        params[:format] = format.ref
        params[:only_path] = true
        if @alternate_formats.include? params[:format]
          headers['Content-Location'] = url_for params
        end
      end
    end
      
  end
end<commit_msg>Tidy up<commit_after>module AlternateRails
  module ControllerHelpers

    def alternate_formats(formats)
      @alternate_formats = formats
      send_headers
    end
    
    def send_headers
      if params[:format].nil?
        params[:format] = request.format.ref
        params[:only_path] = true
        if @alternate_formats.include? params[:format]
          headers['Content-Location'] = url_for params
        end
      end
    end
      
  end
end
{'fraction_non_alphanumeric': 0.07784431137724551, 'fraction_numerical': 0.0, 'mean_word_length': 2.4586206896551723, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2877165', 'n_tokens_mistral': 286, 'n_tokens_neox': 285, 'n_words': 61}