Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests 2023 #159

Merged
merged 5 commits into from
Jan 21, 2023
Merged

Tests 2023 #159

merged 5 commits into from
Jan 21, 2023

Conversation

ryankopf
Copy link
Member

  • Fixed dangerous YAML loading vulnerability, several have been identified in the past and present, and so we've changed it to JSON only.
  • Rebuilt integration tests

end

# Uses the stored location value from the cookie if it exists. If
# no cookie exists, calls out to the web service to get the location.
def retrieve_location_from_cookie_or_service
return GeoLoc.new(YAML.load(cookies[:geo_location])) if cookies[:geo_location]
# return GeoLoc.new(YAML.load(cookies[:geo_location])) if cookies[:geo_location]
return GeoLoc.new(JSON.parse(cookies[:geo_location])) if cookies[:geo_location]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [85/80]

end

# Uses the stored location value from the cookie if it exists. If
# no cookie exists, calls out to the web service to get the location.
def retrieve_location_from_cookie_or_service
return GeoLoc.new(YAML.load(cookies[:geo_location])) if cookies[:geo_location]
# return GeoLoc.new(YAML.load(cookies[:geo_location])) if cookies[:geo_location]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [86/80]

@@ -28,13 +24,14 @@ def geocode_ip_address(filter_options = {})
# get the value.
def store_ip_location
session[:geo_location] ||= retrieve_location_from_cookie_or_service
cookies[:geo_location] = { :value => session[:geo_location].to_yaml, :expires => 30.days.from_now } if session[:geo_location]
cookies[:geo_location] = { :value => session[:geo_location].to_json, :expires => 30.days.from_now } if session[:geo_location]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
Metrics/LineLength: Line is too long. [131/80]

@@ -1,3 +1,3 @@
module GeokitRails
VERSION = "2.4.0.pre"
VERSION = "2.5.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/MutableConstant: Freeze mutable objects assigned to constants.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require_relative "config/application"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@success.lng = -88.4588
@success.city = "Sugar Grove"
@success.state = "IL"
@success.country_code = "US"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@success.lat = 41.7696
@success.lng = -88.4588
@success.city = "Sugar Grove"
@success.state = "IL"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

@success.provider = "hostip"
@success.lat = 41.7696
@success.lng = -88.4588
@success.city = "Sugar Grove"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

end
def setup
@success = Geokit::GeoLoc.new
@success.provider = "hostip"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

def set_ip_bad
request.remote_ip = "bad ip"
end
def setup
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/EmptyLineBetweenDefs: Use empty lines between method definitions.

@ryankopf ryankopf merged commit 7ffc581 into master Jan 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant