-
Notifications
You must be signed in to change notification settings - Fork 245
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
Tests 2023 #159
Conversation
ryankopf
commented
Jan 21, 2023
- 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] |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.