# Issue with Onebox not working for videos larger than 5MB

**URL:** https://meta.discourse.org/t/issue-with-onebox-not-working-for-videos-larger-than-5mb/391807
**Category:** Support
**Created:** [20 december 2025 om 13:00 UTC](https://meta.discourse.org/t/issue-with-onebox-not-working-for-videos-larger-than-5mb/391807 "2025-12-20T13:00:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![copymonopoly](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@copymonopoly](https://meta.discourse.org/u/copymonopoly)
#### Post date: [20 december 2025 om 13:00 UTC](https://meta.discourse.org/t/issue-with-onebox-not-working-for-videos-larger-than-5mb/391807/1 "2025-12-20T13:00:15Z")

</div>

I noticed that when using Discourse, video links larger than 5MB fail to generate a Onebox.  
Looking at the logs, the error occurs at:

```plaintext
/var/www/discourse/lib/final_destination.rb:249:in `block in resolve'

```

I checked `final_destination.rb` and found the following code:

```plaintext
MAX_REQUEST_SIZE_BYTES = 5_242_880 # 1024 * 1024 * 5
request_start_time = Time.now
response_body = +""
request_validator =
  lambda do |chunk, _remaining_bytes, _total_bytes|
    response_body << chunk
    if response_body.bytesize > MAX_REQUEST_SIZE_BYTES
      raise Excon::Errors::ExpectationFailed.new("response size too big: #{@uri}")
    end
    if Time.now - request_start_time > MAX_REQUEST_TIME_SECONDS
      raise Excon::Errors::ExpectationFailed.new("connect timeout reached: #{@uri}")
    end
  end

```

However, on other Discourse sites—both the official forum and another Discourse site I manage—Onebox works fine for videos larger than 5MB.  
I can confirm that on my other Discourse site, `MAX_REQUEST_SIZE_BYTES` has not been modified in any way.  
Could someone explain why this is happening, and how I can fix it?
