mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Add amazon sites to force_get_hosts (#12341)
It has been observed that doing a HEAD against an Amazon store URL may result in a 405 error being returned. Skipping the HEAD request may result in an improved oneboxing experience when requesting these URLs.
This commit is contained in:
@ -27,7 +27,12 @@ module Oneboxer
|
||||
end
|
||||
|
||||
def self.force_get_hosts
|
||||
@force_get_hosts ||= ['http://us.battle.net', 'https://news.yahoo.com/']
|
||||
@force_get_hosts ||= begin
|
||||
hosts = ['http://us.battle.net', 'https://news.yahoo.com']
|
||||
amazon_suffixes = %w(com com.br ca cn fr de in it co.jp com.mx nl pl sa sg es se com.tr ae co.uk)
|
||||
|
||||
hosts + amazon_suffixes.collect { |suffix| "https://www.amazon.#{suffix}" }
|
||||
end
|
||||
end
|
||||
|
||||
def self.force_custom_user_agent_hosts
|
||||
|
Reference in New Issue
Block a user