Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-24 21:09:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-24 21:09:51 +0300
commit12ce3cc57c9f97bacdbb1ea361df833c7fb4350d (patch)
treef6cb314174929aeac893be68b62894d5234652ee /lib/gitlab/webpack
parenta17eb314cff10a779ef550b1eb203ec9a61afdb9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/webpack')
-rw-r--r--lib/gitlab/webpack/manifest.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/gitlab/webpack/manifest.rb b/lib/gitlab/webpack/manifest.rb
index 3424f16b852..7a8f5f2a27a 100644
--- a/lib/gitlab/webpack/manifest.rb
+++ b/lib/gitlab/webpack/manifest.rb
@@ -90,12 +90,17 @@ module Gitlab
def load_dev_server_manifest
host = ::Rails.configuration.webpack.dev_server.host
port = ::Rails.configuration.webpack.dev_server.port
- http = Net::HTTP.new(host, port)
- http.use_ssl = ::Rails.configuration.webpack.dev_server.https
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
- http.get(dev_server_path).body
+ scheme = ::Rails.configuration.webpack.dev_server.https ? 'https' : 'http'
+ uri = Addressable::URI.new(scheme: scheme, host: host, port: port, path: dev_server_path)
+
+ # localhost could be blocked via Gitlab::HTTP
+ response = HTTParty.get(uri.to_s, verify: false) # rubocop:disable Gitlab/HTTParty
+
+ return response.body if response.code == 200
+
+ raise "HTTP error #{response.code}"
rescue => e
- raise ManifestLoadError.new("Could not load manifest from webpack-dev-server at http://#{host}:#{port}#{dev_server_path} - is it running, and is stats-webpack-plugin loaded?", e)
+ raise ManifestLoadError.new("Could not load manifest from webpack-dev-server at #{uri} - is it running, and is stats-webpack-plugin loaded?", e)
end
def load_static_manifest