<commit_before>module NanoApi
  class ApplicationController < ::ApplicationController
    skip_before_filter :verify_authenticity_token
    nano_extend

  protected

    def forward_json json, status = :ok
      response.content_type = Mime::JSON
      response.headers['X-Yasen-EID'] = json.headers[:x_yasen_eid] if json.respond_to?(:headers)
      render text: json, status: status
    end
  end
end<commit_msg>fix(x-yasen-eid): do not set header if it's gone<commit_after>module NanoApi
  class ApplicationController < ::ApplicationController
    skip_before_filter :verify_authenticity_token
    nano_extend

  protected

    def forward_json json, status = :ok
      response.content_type = Mime::JSON
      if json.respond_to?(:headers) && json.headers[:x_yasen_eid]
	      response.headers['X-Yasen-EID'] = json.headers[:x_yasen_eid]
	  end
      render text: json, status: status
    end
  end
end
{'fraction_non_alphanumeric': 0.08839779005524862, 'fraction_numerical': 0.0, 'mean_word_length': 3.978021978021978, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6882484', 'n_tokens_mistral': 297, 'n_tokens_neox': 285, 'n_words': 64}