You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
459 B

  1. # frozen_string_literal: true
  2. class Api::V1::StreamingController < Api::BaseController
  3. def index
  4. if Rails.configuration.x.streaming_api_base_url != request.host
  5. redirect_to streaming_api_url, status: 301
  6. else
  7. not_found
  8. end
  9. end
  10. private
  11. def streaming_api_url
  12. Addressable::URI.parse(request.url).tap do |uri|
  13. uri.host = Addressable::URI.parse(Rails.configuration.x.streaming_api_base_url).host
  14. end.to_s
  15. end
  16. end