<commit_before>require 'rubygems'
require 'bundler'
require 'open-uri'
Bundler.require

class App < Sinatra::Base
  set :app_file, __FILE__

  before do
    headers 'Cache-Control'               => 'public, max-age=31536000',
            'Expires'                     => (Time.now + 31536000).httpdate,
            'Access-Control-Allow-Origin' => '*'
  end

  get '/:font_face' do
    headers['Content-Type'] = case params[:font_face]
                                when /\.ttf$/  then 'font/truetype'
                                when /\.otf$/  then 'font/opentype'
                                when /\.woff$/ then 'font/woff'
                                when /\.eot$/  then 'application/vnd.ms-fontobject'
                                when /\.svg$/  then 'image/svg+xml'
                              end
    send_file open("#{ENV['S3_URL']}/#{params[:font_face]}")
  end
end<commit_msg>rolling back send_data/send_file stuff. not working.<commit_after>require 'rubygems'
require 'bundler'
require 'open-uri'
Bundler.require

class App < Sinatra::Base
  set :app_file, __FILE__

  before do
    headers 'Cache-Control'               => 'public, max-age=31536000',
            'Expires'                     => (Time.now + 31536000).httpdate,
            'Access-Control-Allow-Origin' => '*'
  end

  get '/:font_face' do
    headers['Content-Type'] = case params[:font_face]
                                when /\.ttf$/  then 'font/truetype'
                                when /\.otf$/  then 'font/opentype'
                                when /\.woff$/ then 'font/woff'
                                when /\.eot$/  then 'application/vnd.ms-fontobject'
                                when /\.svg$/  then 'image/svg+xml'
                              end
    open("#{ENV['S3_URL']}/#{params[:font_face]}").read
  end
end
{'fraction_non_alphanumeric': 0.13355048859934854, 'fraction_numerical': 0.018458197611292075, 'mean_word_length': 1.4154652686762779, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '147475', 'n_tokens_mistral': 607, 'n_tokens_neox': 540, 'n_words': 113}