Skip to content

Commit

Permalink
Fix class references
Browse files Browse the repository at this point in the history
  • Loading branch information
joelvh committed Sep 14, 2018
1 parent fe2e09e commit cc8dd41
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ config.middleware.use Rack::Cloudflare::Middleware::RewriteHeaders
You can customize whether rewritten headers should be backed up and what names to use.

```ruby
# Toggle header backups
# Toggle header backups (default: true)
Rack::Cloudflare::Headers.backup = false

# Rename backed up headers (defaults: "ORIGINAL_REMOTE_ADDR", "ORIGINAL_FORWARDED_FOR")
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RubyCritic::RakeTask.new do |task|
# task.name = 'something_special'

# # Glob pattern to match source files. Defaults to FileList['.'].
task.paths = FileList['apps/**/*.rb', 'lib/**/*.rb']
task.paths = FileList['lib/**/*.rb']

# # You can pass all the options here in that are shown by "rubycritic -h" except for
# # "-p / --path" since that is set separately. Defaults to ''.
Expand Down
2 changes: 1 addition & 1 deletion lib/rack/cloudflare/headers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def ray
# "Cf-Visitor: { \"scheme\":\"https\"}"
def visitor
return unless has?(HTTP_CF_VISITOR)
JSON.parse @headers[HTTP_CF_VISITOR]
::JSON.parse @headers[HTTP_CF_VISITOR]
end

def remote_addr
Expand Down
6 changes: 3 additions & 3 deletions lib/rack/cloudflare/ips.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ def refresh!
end

def fetch(url)
parse Net::HTTP.get(URI(url))
parse ::Net::HTTP.get(URI(url))
end

def read(filename)
parse File.read(filename)
parse ::File.read(filename)
end

def parse(string)
return [] if string.to_s.strip.empty?
string.split(/[,\s]+/).map { |ip| IPAddr.new(ip.strip) }
string.split(/[,\s]+/).map { |ip| ::IPAddr.new(ip.strip) }
end
end

Expand Down

0 comments on commit cc8dd41

Please sign in to comment.