Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
takkii committed Jan 1, 2025
1 parent a79ea63 commit 748844e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ def validate_ipaddress
nodejs_path = "node" + " " + "#{File.dirname(__FILE__) + '/myipad.js'}"
stdout_js, stderr_js, status_js = Open3.capture3(nodejs_path)
# When the server is running, only a few permissions are granted.
ip_match = ENV['IPADDRESS_USER']
ip_win = ENV['IPADDRESS_WIN ']
ip_wsl = ENV['IPADDRESS_WSL ']

# Development is assumed to be in a local environment.
unless "#{stdout_js}".match( /#{ip_match}/o) || {}[:match]
if "#{stdout_js}".match( /#{ip_win}/o) || {}[:match]
# windows, ip address specification, nothing displayed.
elsif "#{stdout_js}".match( /#{ip_wsl}/o) || {}[:match]
# wsl2, ip address specification, nothing displayed.
else
raise MyError, "An exception was raised on its own. Something other than an IP address was matched. Please review."
end
end
Expand Down

0 comments on commit 748844e

Please sign in to comment.