diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 98b12446..8684346d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -40,11 +40,6 @@ class ApplicationController < ActionController::Base http_accept_language.language_region_compatible_from(I18n.public_locales.map(&:to_s)) || I18n.default_locale end - - PRIVATE_IP_BLOCK = IPAddr.new('192.168.0.0/16') - def local_only - raise AccessDenied unless request.ip == '127.0.0.1' || PRIVATE_IP_BLOCK.include?(request.ip) - end def localized_fragment_exist?(key) localized_key = localize_fragment_key(key, locale) diff --git a/app/controllers/pets_controller.rb b/app/controllers/pets_controller.rb index 85d4a305..e4a2046e 100644 --- a/app/controllers/pets_controller.rb +++ b/app/controllers/pets_controller.rb @@ -3,9 +3,6 @@ class PetsController < ApplicationController rescue_from PetType::DownloadError, SwfAsset::DownloadError, :with => :asset_download_error rescue_from Pet::DownloadError, :with => :pet_download_error - protect_from_forgery except: :submit - before_action :local_only, only: :submit - def load if params[:name] == '!' redirect_to roulette_path @@ -30,13 +27,6 @@ class PetsController < ApplicationController end end end - - def submit - viewer_data = HashWithIndifferentAccess.new(JSON.parse(params[:viewer_data])) - @pet = Pet.from_viewer_data(viewer_data, :item_scope => Item.includes(:translations)) - @user = params[:user_id].present? ? User.find(params[:user_id]) : nil - render json: {points: contribute(@user, @pet)} - end protected diff --git a/config/routes.rb b/config/routes.rb index 800f5105..3563ac62 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -45,7 +45,6 @@ OpenneoImpressItems::Application.routes.draw do get '/users/current-user/outfits', to: redirect('/your-outfits') post '/pets/load' => 'pets#load', :as => :load_pet - post '/pets/submit' => 'pets#submit', :method => :post get '/modeling' => 'pets#bulk', :as => :bulk_pets devise_for :auth_users