mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 18:51:08 +08:00
In development mode, relax restrictions on embedding.
This commit is contained in:
@ -22,8 +22,11 @@ class EmbedController < ApplicationController
|
|||||||
private
|
private
|
||||||
|
|
||||||
def ensure_embeddable
|
def ensure_embeddable
|
||||||
|
|
||||||
|
if !(Rails.env.development? && current_user.try(:admin?))
|
||||||
raise Discourse::InvalidAccess.new('embeddable host not set') if SiteSetting.embeddable_host.blank?
|
raise Discourse::InvalidAccess.new('embeddable host not set') if SiteSetting.embeddable_host.blank?
|
||||||
raise Discourse::InvalidAccess.new('invalid referer host') if URI(request.referer || '').host != SiteSetting.embeddable_host
|
raise Discourse::InvalidAccess.new('invalid referer host') if uri.host != SiteSetting.embeddable_host
|
||||||
|
end
|
||||||
|
|
||||||
response.headers['X-Frame-Options'] = "ALLOWALL"
|
response.headers['X-Frame-Options'] = "ALLOWALL"
|
||||||
rescue URI::InvalidURIError
|
rescue URI::InvalidURIError
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<%= link_to(I18n.t('embed.continue'), @topic_view.topic.url, class: 'button', target: '_blank') %>
|
<%= link_to(I18n.t('embed.continue'), @topic_view.topic.url, class: 'button', target: '_blank') %>
|
||||||
<%= link_to(image_tag(SiteSetting.logo_url, class: 'logo'), Discourse.base_url) %>
|
<%= link_to(image_tag(SiteSetting.logo_url, class: 'logo'), Discourse.base_url, target: '_blank') %>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
Reference in New Issue
Block a user