1
0
Fork 0
forked from OpenNeo/impress

Merge pull request #3 from openneo:neopets-url-origin

Use secret NEOPETS_URL_ORIGIN to bypass HTTPS
This commit is contained in:
Emi Dunn-Rankin 2022-08-02 20:47:34 -07:00 committed by GitHub
commit c9117fb318
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -5,7 +5,8 @@ class NeopetsUser
include ActiveModel::Conversion include ActiveModel::Conversion
extend ActiveModel::Naming extend ActiveModel::Naming
GATEWAY_URL = 'http://www.neopets.com/amfphp/gateway.php' NEOPETS_URL_ORIGIN = ENV['NEOPETS_URL_ORIGIN'] || 'http://www.neopets.com'
GATEWAY_URL = NEOPETS_URL_ORIGIN + '/amfphp/gateway.php'
GET_PETS_METHOD = RocketAMF::RemoteGateway.new(GATEWAY_URL). GET_PETS_METHOD = RocketAMF::RemoteGateway.new(GATEWAY_URL).
service('MobileService').action('getPets') service('MobileService').action('getPets')

View file

@ -2,7 +2,8 @@ require 'rocketamf/remote_gateway'
require 'ostruct' require 'ostruct'
class Pet < ActiveRecord::Base class Pet < ActiveRecord::Base
GATEWAY_URL = 'http://www.neopets.com/amfphp/gateway.php' NEOPETS_URL_ORIGIN = ENV['NEOPETS_URL_ORIGIN'] || 'http://www.neopets.com'
GATEWAY_URL = NEOPETS_URL_ORIGIN + '/amfphp/gateway.php'
PET_VIEWER = RocketAMF::RemoteGateway.new(GATEWAY_URL). PET_VIEWER = RocketAMF::RemoteGateway.new(GATEWAY_URL).
service('CustomPetService').action('getViewerData') service('CustomPetService').action('getViewerData')
PET_NOT_FOUND_REMOTE_ERROR = 'PHP: Unable to retrieve records from the database.' PET_NOT_FOUND_REMOTE_ERROR = 'PHP: Unable to retrieve records from the database.'