mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +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
|
||||
|
||||
def self.max_chunk_size(uri)
|
||||
|
||||
# Amazon and YouTube leave the title until very late. Exceptions are bad
|
||||
# but these are large sites.
|
||||
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 300 if uri.host =~ /youtube\.com$/ || uri.host =~ /youtu.be/
|
||||
# Exception for sites that leave the title until very late.
|
||||
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 300 if uri.host =~ /(^|\.)youtube\.com$/ || uri.host =~ /(^|\.)youtu\.be$/
|
||||
return 50 if uri.host =~ /(^|\.)github\.com$/
|
||||
|
||||
# default is 20k
|
||||
20
|
||||
|
|
Loading…
Reference in New Issue
Block a user