- Home
- Skills
- APIs & Backend
- Repair HTTP Range & Partial Response Bugs
More screenshots
Works with the AI tools you already use
Repair HTTP Range & Partial Response Bugs
Diagnose and repair HTTP Range requests, 206/416 handling, Content-Range, resumable downloads, validators, and representation consistency.
$8.99
Repair HTTP Range & Partial Response Bugs
Example session with this skill installed
My Go server returns 416 errors when Chrome tries to resume a download. Here is the handler code. Check the Content-Range logic and the validator check.
- Read your context and instructions
- Compiled the repair http range
I have analyzed the provided Go handler. The issue stems from an off-by-one error in the Content-Range header calculation and a missing check for the If-Range header, which causes the client to fail its consistency check during resume.
HTTP Range Repair Analysis
| Component | Current Behavior | Corrected Behavior |
|---|---|---|
| Range Parsing | end index is treated as exclusive. | end index must be inclusive per RFC 7233. |
| Content-Range | bytes 0-100/100 (invalid length). | bytes 0-99/100 (zero-indexed). |
| Validators | Ignores If-Range header. | Must verify ETag or Last-Modified before 206. |
| Fallback | Always returns 416 on mismatch. | Falls back to 200 OK if If-Range fails. |
Proposed Patch (Go)
func handleRangeRequest(w http.ResponseWriter, r *http.Request, size int64, modTime time.Time, etag string) {
rangeHeader := r.Header.Get("Range")
if rangeHeader == "" {
// Normal 200 OK flow
return
}
// Fix: Verify If-Range validator for resumable consistency
if ifRange := r.Header.Get("If-Range"); ifRange != "" {
if ifRange != etag && ifRange != modTime.Format(http.TimeFormat) {
// Validator mismatch: must return full entity
serveFullContent(w, r)
return
}
}
ranges, err := parseRange(rangeHeader, size)
if err != nil {
w.Header().Set("Content-Range", fmt.Sprintf("bytes */%d", size))
w.WriteHeader(http.StatusRequestedRangeNotSatisfiable)
return
}
ra := ranges[0]
w.Header().Set("Content-Range", ra.contentRange(size)) // Ensure inclusive: bytes start-end/total
w.Header().Set("Accept-Ranges", "bytes")
w.WriteHeader(http.StatusPartialContent)
// ... write io.NewSectionReader
}
Next steps
- Update the
parseRangehelper to return inclusive byte offsets. - Verify that your ETag generation is deterministic across server restarts.
- Test with
curl -H "Range: bytes=0-10" -H "If-Range: invalid-etag"to ensure it falls back to 200 OK.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
Repair HTTP Range & Partial Response Bugs targets production and repository defects around diagnose and repair HTTP Range requests, 206/416 handling, Content-Range, resumable downloads, validators, and representation consistency.. It examines Range parsing and normalization, 206 versus 200 fallback rules, Content-Range and Content-Length correctness, If-Range and validator behavior, compression versus byte-range representation, multi-range support or explicit rejection, client resume/append semantics, proxy/cache compatibility and tests, then establishes one explicit repair contract and focused deterministic validation.
The skill works from repository access or partial evidence such as snippets, logs, configuration, traces, and architecture notes. It preserves existing product/security policy, avoids invented execution claims, and keeps production systems, real credentials, and deployment outside the validation path.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 1 month ago
- Passed all security checks, Safe to install