Spaces:
Running

http-range-desk / index.html
WideChaos's picture
Publish HTTP Range Desk 0.1.0
78e7c43 verified
Raw History Blame Contribute Delete
7.05 kB
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>HTTP Range Desk</title><link rel="stylesheet" href="style.css"></head><body><main><header><p class="eyebrow">Renchao Wu · Local byte-range inspection</p><h1>HTTP Range Desk</h1><p class="lead">See which bytes a range request describes.</p><p>Resolve inclusive offsets, suffixes, validators and overlapping parts without fetching a URL. Keep exact decimal offsets even beyond JavaScript's safe integer range.</p><p class="finding">This is a declared response-planning profile. HTTP servers may ignore Range or choose different permitted policies. A plan is not a verified response from a remote server.</p></header><section><h2>Request and optional local bytes</h2><p>Resource length, validators, date strength and the result of other preconditions are supplied by the request. They are not discovered from a server. A local file can verify actual byte slices and hashes; its timestamps and name are not treated as HTTP validators.</p><div class="controls"><label>Original example<select id="example" disabled></select></label><button id="loadExample" disabled>Load example</button></div><p id="resourceStatus" role="status">Loading original example inventory…</p><label for="request">Range planning request JSON</label><textarea id="request" spellcheck="false" disabled></textarea><p class="hint">GET or HEAD; base_status 200, 304 or 412; length is a decimal string. Dates use canonical IMF-fixdate. Ctrl+Enter computes the current request.</p><label for="file">Optional local file, up to 1 MiB</label><input id="file" type="file" disabled><p id="fileStatus">No local bytes bound. Resource length is asserted metadata.</p><button id="useLength" disabled>Use local file length</button><p class="hint">Choosing a file does not change your JSON. Use its length explicitly, then compute. A length mismatch is rejected. Files are read locally and never uploaded.</p><div class="controls"><button id="run" disabled>Compute range plan</button><button id="restore" disabled>Restore default</button><button id="clear" disabled>Clear</button><button id="download" disabled>Download JSON</button><button id="csv" disabled>Download parts CSV</button></div><p id="status" role="status">No range plan yet.</p></section><section id="result" hidden><h2>Decision under this profile</h2><p id="binding"></p><div class="summary"><div><span>Planned status</span><strong id="statusValue"></strong></div><div><span>Selected payload bytes</span><strong id="selectedValue"></strong></div><div><span>Unique payload bytes</span><strong id="uniqueValue"></strong></div><div><span>Repeated overlap bytes</span><strong id="overlapValue"></strong></div></div><p id="planDetails"></p><p id="actualDetails"></p><p class="hint" id="provenance"></p><h3>Evaluation order</h3><ol id="trace"></ol><p>Other preconditions are a supplied outcome here. Range is not evaluated after a supplied 304/412 or for HEAD. Date-based If-Range uses exact equality and an explicitly asserted strong date, rather than an earlier-than-or-equal comparison.</p><h3>Range member diagnostics</h3><p id="memberSummary"></p><div class="controls"><label>Member view<select id="memberFilter"><option value="all">All parsed members</option><option value="satisfiable">Semantically satisfiable</option><option value="unsatisfiable">Valid but unsatisfiable</option><option value="malformed">Malformed members</option><option value="empty">Ignored empty list members</option></select></label></div><div class="scroll" role="region" aria-label="Range members" tabindex="0"><table><thead><tr><th>Ordinal</th><th>Original<br>member</th><th>Kind</th><th>Parse<br>status</th><th>First<br>requested</th><th>Last<br>requested</th><th>Suffix<br>length</th><th>Satisfiable</th><th>Resolved<br>first</th><th>Exclusive<br>end</th><th>Resolved<br>length</th></tr></thead><tbody id="memberRows"></tbody></table></div><p id="memberCount"></p><h3>Selected parts, in request order</h3><p>Repeated and overlapping parts are retained. Their summed payload length excludes multipart boundaries and part headers. The actual wire-body length is unknown. JSON retains every parsed member and the complete original header, even when this view is filtered.</p><div class="scroll" role="region" aria-label="Selected parts" tabindex="0"><table><thead><tr><th>Part</th><th>Member<br>ordinal</th><th>First<br>inclusive</th><th>Last<br>inclusive</th><th>Exclusive<br>end</th><th>Length</th><th>Planned<br>Content-Range</th><th>Observed slice<br>SHA-256</th><th>First 32 bytes<br>hex preview</th></tr></thead><tbody id="partRows"></tbody></table></div><h3>Unique coverage, for diagnosis</h3><p>This union merges overlapping and adjacent intervals only to count unique bytes. It does not rewrite the requested parts or assemble an HTTP multipart body.</p><div class="scroll" role="region" aria-label="Unique coverage" tabindex="0"><table><thead><tr><th>First inclusive</th><th>Last inclusive</th><th>Exclusive end</th><th>Length</th></tr></thead><tbody id="unionRows"></tbody></table></div></section><section><h2>What the plan can and cannot tell you</h2><p>Byte ranges address the encoded representation's octets, not text characters or decompressed bytes. A selected slice may split a UTF-8 character. Local previews therefore show hexadecimal bytes, not a fabricated decoded string.</p><p>A nonzero suffix is semantically satisfiable even for a zero-length representation. This profile then chooses the permitted policy of ignoring Range for an empty representation, producing a full 200 plan with zero selected bytes. It never invents a last byte at −1.</p><p>Malformed ranges are ignored under this profile. Unsupported units are ignored; values beyond the declared processing limits produce an outside-profile diagnostic with no predicted response status. Other servers can make different permitted choices.</p><p>Resource length is limited to 2⁶³−1 and supplied as an exact decimal string. Range numerals may contain up to 256 digits. This profile supports at most 64 nonempty ranges and 64 empty list members; these limits do not define HTTP itself.</p><p>The original cases and the independent verifier include huge offsets, zero suffixes, weak ETags, future dates, whole-header invalidation and the difference between repeated payload bytes and unique coverage. A real local standard-library server test also demonstrates that a server can ignore a valid Range and return a full 200 response.</p><p><a href="README.md">Readme and examples</a> · <a href="STATIC-API.md">Exact input and export contract</a> · <a href="VALIDATION.md">Validation evidence</a> · <a href="SOURCES.md">RFC sources and scope</a></p></section><footer><p>Original code, fixtures and sample bytes: Apache-2.0 · Renchao Wu. No network downloader, model training, remote inference, account, application telemetry or persistent storage.</p></footer></main><script type="module" src="app.mjs"></script></body></html>