You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 8, 2024. It is now read-only.
Upon mounting the engine, I am unable to access the /webhooks/debug route.
My suggested fix in contentful_rails/development_constraint.rb:
module ContentfulRails
# Constraint for ensuring development origin
class DevelopmentConstraint
# Returns if current request is coming from development environment or localhost
def self.matches?(request)
Rails.env =~ %r{development} && (request.remote_ip =~ %r{127.0.0} || request.remote_ip =~ %r{^::1$})
end
end
end
Due to https://stackoverflow.com/a/12384762/3674071 stating that the %r{} syntax allows you to use / without having to escape them. We don't want to check whether or not the Rails.env = "/development/", but if its "development". Applies concept to the request.remote_ip assertions as well.
The text was updated successfully, but these errors were encountered:
Upon mounting the engine, I am unable to access the
/webhooks/debug
route.My suggested fix in
contentful_rails/development_constraint.rb
:Due to https://stackoverflow.com/a/12384762/3674071 stating that the
%r{}
syntax allows you to use/
without having to escape them. We don't want to check whether or not theRails.env = "/development/"
, but if its"development"
. Applies concept to therequest.remote_ip
assertions as well.The text was updated successfully, but these errors were encountered: