mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
include new /24 for paypal notify hook ip sources
This commit is contained in:
parent
62df9c47e9
commit
0d4ebf42ac
1 changed files with 5 additions and 2 deletions
|
@ -11,8 +11,11 @@ post '/webhooks/paypal' do
|
|||
end
|
||||
|
||||
def valid_paypal_webhook_source?
|
||||
# https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1465&viewlocale=en_US&direct=en
|
||||
return true if ['127.0.0.1', '173.0.81.1', '173.0.81.33', '66.211.170.66'].include?(request.ip)
|
||||
# https://www.paypal.com/us/smarthelp/article/what-are-the-ip-addresses-for-live-paypal-servers-ts1056
|
||||
request_ip = IPAddress::IPv4.new request.ip
|
||||
['127.0.0.1', '66.211.170.66', '173.0.81.0/24'].each do |ip|
|
||||
return true if IPAddress::IPv4.new(ip).include? request_ip
|
||||
end
|
||||
false
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue