1
0
Fork 0
forked from OpenNeo/impress

Remove the now-unused pets#submit action

This was used by the Neopia server to send us the modeling data it requested out-of-band. But now we do all our modeling requests back in-app again, so we don't need this!
This commit is contained in:
Emi Matchu 2023-10-12 23:11:33 -07:00
parent d8b0bf3174
commit 2c98c1c636
3 changed files with 0 additions and 16 deletions

View file

@ -41,11 +41,6 @@ class ApplicationController < ActionController::Base
I18n.default_locale I18n.default_locale
end 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) def localized_fragment_exist?(key)
localized_key = localize_fragment_key(key, locale) localized_key = localize_fragment_key(key, locale)
fragment_exist?(localized_key) fragment_exist?(localized_key)

View file

@ -3,9 +3,6 @@ class PetsController < ApplicationController
rescue_from PetType::DownloadError, SwfAsset::DownloadError, :with => :asset_download_error rescue_from PetType::DownloadError, SwfAsset::DownloadError, :with => :asset_download_error
rescue_from Pet::DownloadError, :with => :pet_download_error rescue_from Pet::DownloadError, :with => :pet_download_error
protect_from_forgery except: :submit
before_action :local_only, only: :submit
def load def load
if params[:name] == '!' if params[:name] == '!'
redirect_to roulette_path redirect_to roulette_path
@ -31,13 +28,6 @@ class PetsController < ApplicationController
end 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 protected
def contribute(user, pet) def contribute(user, pet)

View file

@ -45,7 +45,6 @@ OpenneoImpressItems::Application.routes.draw do
get '/users/current-user/outfits', to: redirect('/your-outfits') get '/users/current-user/outfits', to: redirect('/your-outfits')
post '/pets/load' => 'pets#load', :as => :load_pet post '/pets/load' => 'pets#load', :as => :load_pet
post '/pets/submit' => 'pets#submit', :method => :post
get '/modeling' => 'pets#bulk', :as => :bulk_pets get '/modeling' => 'pets#bulk', :as => :bulk_pets
devise_for :auth_users devise_for :auth_users