<commit_before>class DocumentsController < ApplicationController

  before_filter :require_instructor, :except => :show
  before_filter :get_course

  def index
  end

  def show
    @document = @course.documents.find(params[:id])

#    response.headers['X-Accel-Redirect'] = @document.full_filename
#    response.headers['Content-Type'] = @document.content_type
#    response.headers['Content-length'] = @document.size
#    response.headers['Content-Disposition'] = %Q|attachment; filename="#{@document.filename}"|
#
#    render :nothing => true
    send_file @document.full_filename, :type => @document.content_type
  end

  def new<commit_msg>trying to use nginx sendfile again<commit_after>class DocumentsController < ApplicationController

  before_filter :require_instructor, :except => :show
  before_filter :get_course

  def index
  end

  def show
    @document = @course.documents.find params[:id]

    response.headers['X-Accel-Redirect'] = @document.full_filename
    response.headers['Content-Type'] = @document.content_type
    response.headers['Content-length'] = @document.size
    response.headers['Content-Disposition'] = %Q|attachment; filename="#{@document.filename}"|

    render :nothing => true
#    send_file @document.full_filename, :type => @document.content_type
  end

  def new
{'fraction_non_alphanumeric': 0.12471308339709258, 'fraction_numerical': 0.0, 'mean_word_length': 4.865470852017937, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1996277', 'n_tokens_mistral': 392, 'n_tokens_neox': 374, 'n_words': 75}