1
0

streaming_controller.rb 459 B

12345678910111213141516171819
  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