<commit_before>module Api::V1
  class MicropostsController < ApiController
    doorkeeper_for :index,  :show,   scopes: %w"public"
    doorkeeper_for :create, :update, scopes: %w"admin write"
    respond_to     :json

    def index
      @microposts = Micropost.all
      respond_with @microposts
    end

    def create
      micropost = Micropost.new(micropost_params)
      micropost.user = current_resource_owner
      micropost.save!
      respond_with micropost
    end

    private

    def micropost_params
      params.require(:micropost).permit(:content)
    end
  end
end
<commit_msg>avoid "Can't verify CSRF token authenticity" via API<commit_after>module Api::V1
  class MicropostsController < ApiController
    doorkeeper_for :index,  :show,   scopes: %w"public"
    doorkeeper_for :create, :update, scopes: %w"admin write"
    respond_to     :json

    # avoid "Can't verify CSRF token authenticity"
    skip_before_filter :verify_authenticity_token

    def index
      @microposts = Micropost.all
      respond_with @microposts
    end

    def create
      micropost = Micropost.new(micropost_params)
      micropost.user = current_resource_owner
      micropost.save!
      respond_with micropost
    end

    private

    def micropost_params
      params.require(:micropost).permit(:content)
    end
  end
end

{'fraction_non_alphanumeric': 0.07062359128474831, 'fraction_numerical': 0.0015026296018031556, 'mean_word_length': 3.111111111111111, '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': '4255971', 'n_tokens_mistral': 444, 'n_tokens_neox': 428, 'n_words': 99}