What request header is used for resuming a large file download, and what will the server return if it does not support it?

📅 2026-10-11 👁️ 31

The breakpoint resuming download of large attachments relies on which request header: it relies on the Range header within the request. The client specifies in the next request where it wants to start from, and if the server supports range requests, it uses 206 Partial Content to only return this segment; if the server does not support range requests, it will return what is the second question - it will simply ignore this request header and return the entire resource with a 200 status code. Understanding the reasons for the failure of breakpoint resuming is crucial in distinguishing between the two latter cases.

What do the three status codes mean?

In accordance with the protocol document: return 206 for valid range, where the server provides part of the content within the requested byte range; return 416 Range Not Satisfiable if the range is invalid (for example, if the start position exceeds the file length); servers that do not support range requests should ignore the header and return the entire resource with 200.

It is the third one that is most easily misjudged. The client sees 200 and thinks it is 'I didn't send the range request header', actually the server has explicitly expressed once 'I don't support'. The document also mentions that early download tools would look at the Accept-Ranges: none in the response header to主动关掉暂停与续传功能,but due to the 'ignoring range request header' itself has the same meaning, this kind of writing is now rare.

The sequence is therefore very clear: send a HEAD or OPTIONS request first, check if there is Accept-Ranges: bytes in the response; if there is, discuss resuming; if not or the value is none, it means that this link can only be re-downloaded in full.

The byte offset starts from zero, and the right end can be omitted

The range notation uses a closed interval, with both the start and end positions calculated in bytes, and counting starts from zero. There are three common ways: only giving the start position to indicate 'from here to the end of the file', giving a complete range to indicate an exact range, and giving a negative number to indicate 'just the last few bytes'.

A request header can contain multiple segments at the same time, and the server may return the document in multiple segments. However, for resuming, it is more worthwhile to make use of another property: when only a single segment byte range is specified in the request header, this header belongs to the cross-domain security list header under cross-domain scenarios, and cross-domain requests do not need to go through the preflight. This is exactly the combination commonly used by media segment access and downloader resuming - a single segment is easy to handle and will not result in an additional round trip due to cross-domain.

Two types of scenarios of large files on the site

The appearance of

Both types need to pay attention to the same thing: whether the range request is available depends on the layer that finally outputs the file. When the program generates the download response itself, write 206 and the relevant headers according to the specification; if there is a gateway or cache in front, it is necessary to confirm that this layer will not swallow the entire range request or return a 200 without interval information.

After modifying, it is recommended to verify three scenarios separately: a single segment request from the beginning, an invalid range exceeding the file length (should return 416), and a complete request to the same address (should return 200 and include Accept-Ranges: bytes). All three returns are correct; breakpoint continuation is only truly available.

Common questions

Question: Is it misconfigured if the return is 200?Answer: Not necessarily. Ignoring the header and returning the entire resource when range requests are not supported is a behavior allowed by the specification. In this case, you should switch to complete download or confirm which layer does not support it.

Why do I keep getting the entire file when resuming download?Mostly, it's because the intermediate layer has turned the range request into a complete request. It's more effective to check layer by layer whether the request header and 206 response are passed through than just changing the download logic.

Is it more economical to request multiple intervals at once?Multiple segments will introduce the cost of multiple document responses and parsing. In most cases, it is simpler and easier to directly connect across domains by processing the transfer by single segment intervals.

Related articles

How to turn off camera and location capabilities by default in the response header for web pages that do not need them?

Using the Permissions-Policy response header to turn off camera, microphone, and location capabilities not used by the page, the core is that the default allowed list values only have three: asterisk, same-origin, and empty. This article explains the scope of this header, why the nested frame must appear in the parent page list at the same time, and the boundary that the allow attribute can only be narrowed but not broadened.

2026-10-11

What's the difference between returning 451 when a page is taken down due to compliance requirements and directly giving a 404?

Pages taken down due to compliance requirements should return 451 or 404? The difference is not in whether the page is accessible, but in which layer the reason for unavailability is written in the status code. This article explains the semantic boundaries of 451, the responsibility party's explanation of where it should be written in the response body or link, and the handling of taken-down pages in the site map and content review process.

2026-10-11

What are the entry requirements for taking back the mandatory jump to HTTPS after joining the preload list?

To bring back the mandatory jump to HTTPS of the site, it is necessary to distinguish between two layers: the response header only takes effect for browsers that have already visited, and after entering the preloading whitelist, the threshold is a validity period of at least one year and must include subdomains. This article explains the criteria for both, why it is necessary to go through a secure request when撤销ing, and which layer to change when modifying the configuration within the site.

2026-10-11

Why should directory upload be prohibited from type sniffing, and what are the differences in configuration methods between the two types of web servers?

The upload directory needs to add a response header to prohibit type sniffing because browsers default to inferring types based on content, so uploaded files may be executed as scripts. After prohibition, browsers only process types declared, and script and style class request types that do not match will be blocked directly. This article compares the differences between Apache and Nginx in issuing this rule and provides the check sequence for deployment.

2026-10-11

The security version of the content system fixes multiple issues at once, and the appearance of an AI research institution in the report indicates what.

In a content system's security release statement, multiple fixes have appeared from AI research institutions and security audit companies. This is more like a change in the division of labor in the vulnerability discovery process: auxiliary audit has started to enter the disclosure process. This article reads this announcement item by item and gives three places to check when following up on the site.

2026-10-11

The open-source content system posted a security patch preview days in advance, what should the operation and maintenance team do in these days?

The security patch preview only provides the time window and risk level, without giving details of the vulnerability. The preparations that can be made in these days are therefore very specific: confirm whether the module is within the scope, back up the data and static files, practice the upgrade path on the copy, prepare the checklist for the release day, and reserve time for rollback and review.

2026-10-11

The security announcement for the form module only covers two version ranges, should the site be upgraded first or disable the submission function first?

A security announcement for a form module provides two affected ranges and two fixed versions. The order of handling should be decided by the branch and exposure surface: if it can be upgraded to the corresponding fixed version immediately, it should be upgraded first. If the upgrade needs to be scheduled, consider temporarily closing the external submission entry and record the scope of closure and recovery conditions.

2026-10-11

How should the announcement that bypasses the input filter be arranged from the version a few years ago to the present?

The announcement bypassing the input filters lists the affected versions from versions years ago to the current branch, with the rating only given to medium. The disposal order of old sites should be arranged according to upgradability and exposure: first confirm whether it can be upgraded to the fixed version, then decide whether to narrow the entry or plan for migration, and clarify the responsibilities of the filtering layer and the escaping layer.

2026-10-11