mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 19:03:45 +08:00
FIX: inline onebox for github (#15859)
Increase size of downloaded HTML for Github when getting title for inline Onebox.
This commit is contained in:
parent
d4be987cc8
commit
803fd7289d
|
@ -41,11 +41,10 @@ module RetrieveTitle
|
||||||
private
|
private
|
||||||
|
|
||||||
def self.max_chunk_size(uri)
|
def self.max_chunk_size(uri)
|
||||||
|
# Exception for sites that leave the title until very late.
|
||||||
# Amazon and YouTube leave the title until very late. Exceptions are bad
|
return 500 if uri.host =~ /(^|\.)amazon\.(com|ca|co\.uk|es|fr|de|it|com\.au|com\.br|cn|in|co\.jp|com\.mx)$/
|
||||||
# but these are large sites.
|
return 300 if uri.host =~ /(^|\.)youtube\.com$/ || uri.host =~ /(^|\.)youtu\.be$/
|
||||||
return 500 if uri.host =~ /amazon\.(com|ca|co\.uk|es|fr|de|it|com\.au|com\.br|cn|in|co\.jp|com\.mx)$/
|
return 50 if uri.host =~ /(^|\.)github\.com$/
|
||||||
return 300 if uri.host =~ /youtube\.com$/ || uri.host =~ /youtu.be/
|
|
||||||
|
|
||||||
# default is 20k
|
# default is 20k
|
||||||
20
|
20
|
||||||
|
|
Loading…
Reference in New Issue
Block a user