title: Content-Length vs complete-length
body: <p>I have a case where I am uploading a file and I know the final size once the upload is complete and provide this information when someone is requesting the file while the upload is still in progress.</p>
  <p>My problem is <strong>range</strong> requests vs <strong>non range</strong> request and how to handle the resource size.</p>
  <p>In the case of <strong>non range</strong> request I always set <code>Content-Length</code> to the <em>expected/final size</em> of the resource and let the server tail the file.</p>
  <p>In the case of <strong>range</strong> request I set the <code>*/{complete-length}</code> to the <em>current size</em> of the resource and the server returns the current payload <strong>without</strong> tailing the file.</p>
  <p>What I'm unsure of is whether this is spec compliant?</p>
  <p>In terms of <strong>non range</strong> request the <a href="https://httpwg.org/specs/rfc7230.html#header.content-length" rel="nofollow noreferrer">spec</a> says:</p>
  <blockquote>
  <p>the Content-Length indicates the <strong>size</strong> of the selected representation</p>
  </blockquote>
  <p>While in terms of range request the <a href="https://httpwg.org/specs/rfc7233.html#header.content-range" rel="nofollow noreferrer">spec</a> says:</p>
  <blockquote>
  <p>The complete-length in a 416 response indicates the <strong>current length</strong> of the selected representation.</p>
  </blockquote>
  <p>So the question here is whether the spec means that these two are the same or not. My current implementation assumes they are not the same, i.e:</p>
  <ul>
  <li><code>Content-Length</code> is the final/expected size of the resource</li>
  <li><code>complete-length</code> is the current size of the resource</li>
  </ul>