Skip to content

Commit

Permalink
Remove header equality (#127)
Browse files Browse the repository at this point in the history
* Remove header equality

* Grammar
  • Loading branch information
jakearchibald authored May 23, 2019
1 parent d29360a commit 0a0e440
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,8 @@ Note: This algorithm checks if a partial response reasonably matches what was re
1. Let |responseFirstBytePos|, <var ignore>responseLastBytePos</var>, and |responseCompleteLength| be the result of [=extracting content-range values=] from |partialResponse|. If this fails, then return invalid.
1. If |responseFirstBytePos| does not equal |expectedRangeStart|, then return invalid.
1. If |previousResponse| is not null, then:
1. If |previousResponse|'s [=response/header list=] [=header list/contains=] \``ETag`\`, and [=header equality=] for \``ETag`\`, |previousResponse|'s [=response/header list=], and |partialResponse|'s [=response/header list=] is false, then return invalid.
1. If |previousResponse|'s [=response/header list=] [=header list/contains=] \``Last-Modified`\`, and [=header equality=] for \``Last-Modified`\`, |previousResponse|'s [=response/header list=], and |partialResponse|'s [=response/header list=] is false, then return invalid.
1. For |headerName| of « \``ETag`\`, \``Last-Modified`\` »:
1. If |previousResponse|'s [=response/header list=] [=header list/contains=] |headerName| and the [=combined value=] of |headerName| in |previousResponse|'s [=response/header list=] does not equal the [=combined value=] of |headerName| in |partialResponse|'s [=response/header list=], then return invalid.
1. If |previousResponse|'s [=response/status=] is `206`, then:
1. Let <var ignore>previousResponseFirstBytePos</var>, <var ignore>previousResponseLastBytePos</var>, and |previousResponseCompleteLength| be the result of [=extracting content-range values=] from |previousResponse|. If this fails, then return invalid.
1. If |previousResponseCompleteLength| is not null, and |responseCompleteLength| does not equal |previousResponseCompleteLength|, then return invalid.
Expand All @@ -446,21 +446,6 @@ Note: This algorithm parses \``Content-Range`\` as a [=single byte content-range
Issue: Parsing as an integer [infra/189](https://github.com/whatwg/infra/issues/189).
</div>

## [=Header equality=] ## {#header-equality-algorithm}

Note: This algorithm returns true if two [=/header lists=] contain the same value for a given header name, or neither has a header of that name.

<div algorithm>
To determine <dfn>header equality</dfn> for a |headerName| (a [=byte sequence=]), in |headerList1| (a [=/header list=]), and |headerList2| (a [=/header list=]), run these steps:

1. If |headerList1| does not [=header list/contain=] |headerName|, and |headerList2| does not [=header list/contain=] |headerName|, then return true.
1. If |headerList1| [=header list/contains=] |headerName|, and |headerList2| [=header list/contains=] |headerName|, then:
1. Let |header1Value| be the [=header/value=] of the first [=header=] whose [=header/name=] is a [=byte-case-insensitive=] match for |headerName| in |headerList1|.
1. Let |header2Value| be the [=header/value=] of the first [=header=] whose [=header/name=] is a [=byte-case-insensitive=] match for |headerName| in |headerList2|.
1. If |header1Value| is identical to |header2Value|, then return true, otherwise return false.
1. Return false.
</div>

## [=Create record objects=] ## {#create-settled-fetches-algorithm}

Note: This algorithm creates platform objects for [=background fetch records=]. It also manages the streaming of the [=/response=] from the stored [=background fetch response/bytes=]. The background fetch operation may still be in progress at this point.
Expand Down

0 comments on commit 0a0e440

Please sign in to comment.