FIX: inline onebox for github (#15859)

Increase size of downloaded HTML for Github when getting title for
inline Onebox.
This commit is contained in:
Krzysztof Kotlarek 2022-02-10 08:53:27 +11:00 committed by GitHub
parent d4be987cc8
commit 803fd7289d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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