From bd415af9a11fe7057c9f428b7bdaeb8d4fb3a77b Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 3 Jan 2024 11:23:58 +0100 Subject: [PATCH] Change streaming API host to not be overridden to localhost in development mode (#28557) --- config/initializers/1_hosts.rb | 2 +- spec/requests/content_security_policy_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/1_hosts.rb b/config/initializers/1_hosts.rb index 6ff0845c46..5c59e28bd1 100644 --- a/config/initializers/1_hosts.rb +++ b/config/initializers/1_hosts.rb @@ -23,7 +23,7 @@ Rails.application.configure do if Rails.env.production? "ws#{https ? 's' : ''}://#{web_host}" else - "ws://#{ENV['REMOTE_DEV'] == 'true' ? host.split(':').first : 'localhost'}:4000" + "ws://#{host.split(':').first}:4000" end end diff --git a/spec/requests/content_security_policy_spec.rb b/spec/requests/content_security_policy_spec.rb index 7610e698cd..d4cc40bce5 100644 --- a/spec/requests/content_security_policy_spec.rb +++ b/spec/requests/content_security_policy_spec.rb @@ -20,7 +20,7 @@ describe 'Content-Security-Policy' do "form-action 'self'", "child-src 'self' blob: https://cb6e6126.ngrok.io", "worker-src 'self' blob: https://cb6e6126.ngrok.io", - "connect-src 'self' data: blob: https://cb6e6126.ngrok.io ws://localhost:4000", + "connect-src 'self' data: blob: https://cb6e6126.ngrok.io ws://cb6e6126.ngrok.io:4000", "script-src 'self' https://cb6e6126.ngrok.io 'wasm-unsafe-eval'" ) end