- def validate_wb2_url_config
- if Rails.configuration.workbench2_url
- begin
- if !URI.parse(Rails.configuration.workbench2_url).is_a?(URI::HTTP)
- Rails.logger.warn("workbench2_url config is not an HTTP URL: #{Rails.configuration.workbench2_url}")
- Rails.configuration.workbench2_url = false
- elsif /.*[\/]{2,}$/.match(Rails.configuration.workbench2_url)
- Rails.logger.warn("workbench2_url config shouldn't have multiple trailing slashes: #{Rails.configuration.workbench2_url}")
- Rails.configuration.workbench2_url = false
- else
- return true
- end
- rescue URI::InvalidURIError
- Rails.logger.warn("workbench2_url config invalid URL: #{Rails.configuration.workbench2_url}")
- Rails.configuration.workbench2_url = false
- end
+ def self.validate_wb2_url_config
+ if Rails.configuration.Services.Workbench2.ExternalURL != URI("")
+ if !Rails.configuration.Services.Workbench2.ExternalURL.is_a?(URI::HTTP)
+ Rails.logger.warn("workbench2_url config is not an HTTP URL: #{Rails.configuration.Services.Workbench2.ExternalURL}")
+ Rails.configuration.Services.Workbench2.ExternalURL = URI("")
+ elsif /.*[\/]{2,}$/.match(Rails.configuration.Services.Workbench2.ExternalURL.to_s)
+ Rails.logger.warn("workbench2_url config shouldn't have multiple trailing slashes: #{Rails.configuration.Services.Workbench2.ExternalURL}")
+ Rails.configuration.Services.Workbench2.ExternalURL = URI("")
+ else
+ return true
+ end