More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    Repair HTTP Range & Partial Response Bugs

    1

    Diagnose and repair HTTP Range requests, 206/416 handling, Content-Range, resumable downloads, validators, and representation consistency.

    $2.99

    Secure checkout via Stripe

    30-day refund guarantee

    Converts to your local currency at checkout

    Security scanned
    Repair HTTP Range & Partial Response Bugs

    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

    ComponentCurrent BehaviorCorrected Behavior
    Range Parsingend index is treated as exclusive.end index must be inclusive per RFC 7233.
    Content-Rangebytes 0-100/100 (invalid length).bytes 0-99/100 (zero-indexed).
    ValidatorsIgnores If-Range header.Must verify ETag or Last-Modified before 206.
    FallbackAlways 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

    1. Update the parseRange helper to return inclusive byte offsets.
    2. Verify that your ETag generation is deterministic across server restarts.
    3. 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.

    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 use

    Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.

    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

    Listed1 month ago
    Updated1 day ago

    What's inside

    Frequently Asked Questions