diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-15 06:17:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-15 06:17:51 +0000 |
commit | 66fc7ba6f3a4a8e74529192f1dd110d87a91fdfb (patch) | |
tree | 40057ad8921ec5cac43db5721c1005d186a0fd07 /app/helpers/webpack_helper.rb | |
parent | 4f6d64e5bde7e55b2b8f8a6afbdcd911486883b1 (diff) | |
download | gitlab-ce-66fc7ba6f3a4a8e74529192f1dd110d87a91fdfb.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/webpack_helper.rb')
-rw-r--r-- | app/helpers/webpack_helper.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/helpers/webpack_helper.rb b/app/helpers/webpack_helper.rb index ba3c232bec4..64900714327 100644 --- a/app/helpers/webpack_helper.rb +++ b/app/helpers/webpack_helper.rb @@ -83,8 +83,16 @@ module WebpackHelper end def webpack_public_host - # We proxy webpack output in 'test' and 'dev' environment, so we can just use asset_host - ActionController::Base.asset_host.try(:chomp, '/') + # We do not proxy the webpack output in the 'test' environment, + # so we must reference the webpack dev server directly. + if Rails.env.test? && Gitlab.config.webpack.dev_server.enabled + host = Gitlab.config.webpack.dev_server.host + port = Gitlab.config.webpack.dev_server.port + protocol = Gitlab.config.webpack.dev_server.https ? 'https' : 'http' + "#{protocol}://#{host}:#{port}" + else + ActionController::Base.asset_host.try(:chomp, '/') + end end def webpack_public_path |