Thanks for developing this useful plugin, Richard.
I made some minor modifications to adapt to my use case: blocking certain URLs for users in certain regions. What I’ve done is, in add_model_callback(:application_controller, :before_action)
, adding some more match rules with request.fullpath
, e.g.:
return unless request.fullpath.start_with?(*SiteSetting.topic_geo_blocking_exact_paths.split('|'))
I find that this URL-level geo-blocking works if I access the URL by directly typing it in the browser navigation bar. However, if I navigate to the URL by clicking it from Discourse homepage, this doesn’t work. (but after pressing F5 to refresh the page, it gets blocked.)
Could you give me any advice to fix this issue? Thanks.