Closed alienxp03 closed 1 year ago
Ah that's annoying. That's Rails (6+) host authorisation https://guides.rubyonrails.org/configuring.html#actiondispatch-hostauthorization rejecting the Parklife request because it's pretending to come from another host (example.com
by default). That particular Rails middleware is only enabled in development which is why the error isn't present in CI - which runs Rails in production mode:
You can allow the host or completely disable host authorisation in config/environments/development.rb
but note that it's a security feature so I would only do it temporarily and not commit the change:
# This must match the host configured in Parklife's `base` (which defaults to example.com).
Rails.application.config.hosts << "example.com"
# Or completely disable host authorisation.
Rails.application.config.hosts = nil
Whilst I develop my Rails app locally in development mode I guess I don't encounter this issue because I don't run the actual Parklife build locally. It would be nice for Parklife to be able to disable this middleware itself when it needs to but by the time Parklife gets involved the Rails app has already booted and been configured and the middleware stack is frozen. But perhaps there's a way.
Ah, cool. Will give it a try again once I read more about the Rails update. Thanks for the pointers!
I've just merged #96 which prevents the 403 response issue - it'll be in the next release.
I'm getting 403 error when I'm trying to test this project. Is there any steps that I'm missing here?