# Onebox failed for videos \>5MB: Servers returning 200 OK instead of 206 Partial Content

**URL:** https://meta.discourse.org/t/onebox-failed-for-videos-5mb-servers-returning-200-ok-instead-of-206-partial-content/395007
**Category:** Support
**Created:** [3 februari 2026 om 06:15 UTC](https://meta.discourse.org/t/onebox-failed-for-videos-5mb-servers-returning-200-ok-instead-of-206-partial-content/395007 "2026-02-03T06:15:44Z")
**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: [3 februari 2026 om 06:15 UTC](https://meta.discourse.org/t/onebox-failed-for-videos-5mb-servers-returning-200-ok-instead-of-206-partial-content/395007/1 "2026-02-03T06:15:45Z")

</div>

Hi everyone,

I’m running into a specific issue where videos larger than 5MB fail to generate Onebox previews on my Discourse instance (standard Docker install), whereas the same video links work perfectly on other Discourse sites.

**The Problem:**  
When I post a video link (e.g., a 5.1MB .webm file), the Onebox fails. I’ve isolated the issue to a failure in Range request negotiation.

**Debugging results from the Rails console:**

- **Manual Ruby Test (Success):** Using standard `Net::HTTP` and manually setting the `Range: bytes=0-10` header, I successfully get a **206 Partial Content** from the source server.
- **Discourse System Test (Failure):** When Discourse attempts to fetch the same URL via `FinalDestination.new(url).get`, it receives a **200 OK** (Net::HTTPOK) instead of a 206. Consequently, it attempts to download the entire file, hits the 5MB `MAX_REQUEST_SIZE_BYTES` limit, and the Onebox fails with a “size too big” error.

**I have already tested the following configurations, but the issue persists:**

1. Set a browser-like string in `onebox_user_agent`.
2. Added the source domain to `force_custom_user_agent_hosts`.
3. Verified the server has no global proxy configured (`env | grep -i proxy` is empty).
4. Tested the same URL on other Discourse instances, where it Oneboxes perfectly.

**The Question:**  
Why would one Discourse instance fail to negotiate a Range request (206) while another instance, pointing to the exact same URL, succeeds on the same network?

Is there any specific internal configuration, security middleware, or `FinalDestination` logic that might be stripping the `Range` headers or causing the remote server to fallback to a full 200 response?

Any insights or pointers on where to look next would be greatly appreciated!
