mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 12:53:42 +08:00
FIX: add referer to version_check request
This commit is contained in:
parent
167f393a03
commit
acfe81e61f
|
@ -34,11 +34,11 @@ module DiscourseHub
|
|||
end
|
||||
|
||||
def self.singular_action(action, rel_url, params={})
|
||||
JSON.parse RestClient.send(action, "#{hub_base_url}#{rel_url}", {params: params, accept: accepts } )
|
||||
JSON.parse RestClient.send(action, "#{hub_base_url}#{rel_url}", {params: params, accept: accepts, referer: referer } )
|
||||
end
|
||||
|
||||
def self.collection_action(action, rel_url, params={})
|
||||
JSON.parse RestClient.send(action, "#{hub_base_url}#{rel_url}", params, content_type: :json, accept: accepts )
|
||||
JSON.parse RestClient.send(action, "#{hub_base_url}#{rel_url}", params, content_type: :json, accept: accepts, referer: referer )
|
||||
end
|
||||
|
||||
def self.hub_base_url
|
||||
|
@ -53,4 +53,8 @@ module DiscourseHub
|
|||
[:json, 'application/vnd.discoursehub.v1']
|
||||
end
|
||||
|
||||
def self.referer
|
||||
Discourse.base_url
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user