lyrasis / aspace-islandora

Plugin to interoperate with Islandora.
3 stars 0 forks source link

Verify deposit requests originate from base url option #16

Open mark-cooper opened 6 years ago

mark-cooper commented 6 years ago

For additional (and optional) security check request origin. Something like:

require 'resolv'
hostname = Resolv.getname request.remote_ip
raise "Request origin error" unless AppConfig[:islandora_config][:base_url] =~ /#{hostname}/

https://ruby-doc.org/stdlib-2.3.1/libdoc/resolv/rdoc/Resolv.html