<commit_before>class MetadataController < ApplicationController
  skip_before_action :validate_cookies

  def service_providers
    render xml: METADATA_CLIENT.idp_metadata
  end

  def identity_providers
    render xml: METADATA_CLIENT.sp_metadata
  end
end
<commit_msg>3659: Serve correct content type and cache correct headers<commit_after>class MetadataController < ApplicationController
  skip_before_action :validate_cookies

  METADATA_CONTENT_TYPE = 'application/samlmetadata+xml'.freeze

  def service_providers
    do_not_cache
    render xml: METADATA_CLIENT.idp_metadata, content_type: METADATA_CONTENT_TYPE
  end

  def identity_providers
    do_not_cache
    render xml: METADATA_CLIENT.sp_metadata, content_type: METADATA_CONTENT_TYPE
  end

  private
  def do_not_cache
    response.headers['Cache-Control'] = 'no-cache, no-store, no-transform'
  end
end

{'fraction_non_alphanumeric': 0.04936854190585534, 'fraction_numerical': 0.004592422502870264, 'mean_word_length': 5.318840579710145, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 5}, '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': '2123148', 'n_tokens_mistral': 285, 'n_tokens_neox': 272, 'n_words': 60}