Permalink
Browse files

Adding algorithm "Does scheme-part match another scheme-part?" (#136)

* adding scheme-part matching

<a grammar></a>

Adding given

* addressing comments

style

<a>ASCII strings</a>
  • Loading branch information...
aubakirova authored and mikewest committed Nov 4, 2016
1 parent 43b6f4a commit cf6dc08055b3b824623187eb56d35e7c242f2296
Showing with 29 additions and 16 deletions.
  1. +29 −16 index.src.html
@@ -3337,22 +3337,9 @@ <h5 id="match-url-to-source-expression" algorithm>
2. If |expression| matches the <a grammar>`scheme-source`</a> or
<a grammar>`host-source`</a> grammar:
1. If |expression| has a <a grammar>`scheme-part`</a> that is not an
<a>ASCII case-insensitive</a> match for |url|'s {{URL/scheme}}, then
return "`Does Not Match`" unless one of the following conditions is
met:
1. |expression|'s <a grammar>`scheme-part`</a> is an <a>ASCII
case-insensitive</a> match for "`http`" and |url|'s {{URL/scheme}}
is "`https`"
2. |expression|'s <a grammar>`scheme-part`</a> is an <a>ASCII
case-insensitive</a> match for "`ws`" and |url|'s {{URL/scheme}}
is "`wss`", "`http`" or "`https`"
3. |expression|'s <a grammar>`scheme-part`</a> is an <a>ASCII
case-insensitive</a> match for "`wss`" and |url|'s {{URL/scheme}}
is "`https`"
1. If |expression| has a <a grammar>`scheme-part`</a> and [[#match-schemes]]
returns "`Does Not Match`" given |expression|'s <a grammar>`scheme-part`</a> and
|url|'s {{URL/scheme}}, return "`Does Not Match`".
2. If |expression| matches the <a grammar>`scheme-source`</a> grammar,
return "`Matches`".
@@ -3480,6 +3467,32 @@ <h5 id="match-url-to-source-expression" algorithm>
5. Return "`Does Not Match`".
<h5 id="match-schemes" algorithm>
Does |scheme-part| match another |scheme-part|?
</h5>
Given two <a>ASCII strings</a> A and B, this algorithm returns "`Matches`" if A
matches B, and returns "`Does Not Match`" otherwise.
Note: This algorithm is not transitive. That is, A matching B does not mean
that B will match A.
1. If one of the following is true, return "`Matches`":
1. A is an <a>ASCII case-insensitive</a> match for B.
2. A is an <a>ASCII case-insensitive</a> match for "`http`", and B is an
<a>ASCII case-insensitive</a> match for "`https`".
3. A is an <a>ASCII case-insensitive</a> match for "`ws`", and B is an
<a>ASCII case-insensitive</a> match for "`wss`", "`http`", or
"`https`".
4. A is an <a>ASCII case-insensitive</a> match for "`wss`", and B is an
<a>ASCII case-insensitive</a> match for "`https`".
2. Return "`Does Not Match`".
<h5 id="effective-directive-for-a-request" algorithm>
Get the effective directive for |request|
</h5>

0 comments on commit cf6dc08

Please sign in to comment.