Add result_count to Mastodon-Async-Refresh header when needed (#36239)

This commit is contained in:
Claire 2025-10-10 14:26:10 +02:00 committed by GitHub
parent 3f2ee09827
commit 0219b7cad7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,9 @@ module AsyncRefreshesConcern
def add_async_refresh_header(async_refresh, retry_seconds: 3)
return unless async_refresh.running?
response.headers['Mastodon-Async-Refresh'] = "id=\"#{async_refresh.id}\", retry=#{retry_seconds}"
value = "id=\"#{async_refresh.id}\", retry=#{retry_seconds}"
value += ", result_count=#{async_refresh.result_count}" unless async_refresh.result_count.nil?
response.headers['Mastodon-Async-Refresh'] = value
end
end