"Fossies" - the Fresh Open Source Software Archive

Member "discourse-2.8.3/config/initializers/100-onebox_options.rb" (14 Apr 2022, 452 Bytes) of package /linux/www/discourse-2.8.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ruby source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 # frozen_string_literal: true
    2 
    3 if Rails.env.development? && SiteSetting.port.to_i > 0
    4   Onebox.options = {
    5     twitter_client: TwitterApi,
    6     redirect_limit: 3,
    7     user_agent: "Discourse Forum Onebox v#{Discourse::VERSION::STRING}",
    8     allowed_ports: [80, 443, SiteSetting.port.to_i]
    9   }
   10 else
   11   Onebox.options = {
   12     twitter_client: TwitterApi,
   13     redirect_limit: 3,
   14     user_agent: "Discourse Forum Onebox v#{Discourse::VERSION::STRING}"
   15   }
   16 end