Allow cross origin requests only for message bus

I forgot to mention but this is the first thing I tried and it didn’t work. But that was before I found out about the Access-Control-Allow-Headers. Maybe it will work if I add them like this.


MessageBus.extra_response_headers_lookup do |env|
 [
    ["Access-Control-Allow-Origin", "http://example.com:3000"],
    ["Access-Control-Allow-Headers", env[HTTP_ACCESS_CONTROL_REQUEST_HEADERS]]
  ]
end

I will try again this way instead of the custom middleware and update this thread.