Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove header equality #127

Merged
merged 2 commits into from
May 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,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 @@ -443,21 +443,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