Raise an error if multiple context HTTP Link Headers are detected
authorMarkus Lanthaler <mark_lanthaler@gmx.net>
Tue, 23 Jul 2013 22:38:06 +0200
changeset 1816 164bdd8aca53
parent 1815 05e86726360c
child 1817 5349548d7579
Raise an error if multiple context HTTP Link Headers are detected

This addresses #264.
spec/latest/json-ld-api/index.html
test-suite/idltest/index.html
--- a/spec/latest/json-ld-api/index.html	Tue Jul 23 21:41:14 2013 +0200
+++ b/spec/latest/json-ld-api/index.html	Tue Jul 23 22:38:06 2013 +0200
@@ -3855,7 +3855,11 @@
             <code>application/ld+json</code>, update the <tref>active context</tref> using the
             <a href="#context-processing-algorithm">Context Processing algorithm</a>, passing the
             context referenced in the HTTP Link Header as <tref>local context</tref>. The
-            HTTP Link Header is ignored for documents served as <code>application/ld+json</code>.</li>
+            HTTP Link Header is ignored for documents served as <code>application/ld+json</code> If
+            multiple HTTP Link Headers using the <code>http://www.w3.org/ns/json-ld#context</code>
+            link relation are found, the <i>promise</i> is rejected with a <a>JsonLdError</a> whose code is set to
+            <code class="error"><a href="#idl-def-JsonLdErrorCode.multiple-context-link-headers">multiple context link headers</a></code>
+            and processing is terminated.</li>
           <li>Set <i>expanded</i> to the result of using the
             <a href="#expansion-algorithm">Expansion algorithm</a>, passing the
             <tref>active context</tref> and <i>input</i> as <i>element</i>.</li>
@@ -3915,7 +3919,11 @@
             <code>application/ld+json</code>, update the <tref>active context</tref> using the
             <a href="#context-processing-algorithm">Context Processing algorithm</a>, passing the
             context referenced in the HTTP Link Header as <tref>local context</tref>. The
-            HTTP Link Header is ignored for documents served as <code>application/ld+json</code>.</li>
+            HTTP Link Header is ignored for documents served as <code>application/ld+json</code> If
+            multiple HTTP Link Headers using the <code>http://www.w3.org/ns/json-ld#context</code>
+            link relation are found, the <i>promise</i> is rejected with a <a>JsonLdError</a> whose code is set to
+            <code class="error"><a href="#idl-def-JsonLdErrorCode.multiple-context-link-headers">multiple context link headers</a></code>
+            and processing is terminated.</li>
           <li>Set <i>expanded</i> to the result of using the
             <a href="#expansion-algorithm">Expansion algorithm</a>, passing the
             <tref>active context</tref> and <i>input</i> as <i>element</i>.</li>
@@ -3966,7 +3974,11 @@
             <code>application/ld+json</code>, update the <tref>active context</tref> using the
             <a href="#context-processing-algorithm">Context Processing algorithm</a>, passing the
             context referenced in the HTTP Link Header as <tref>local context</tref>. The
-            HTTP Link Header is ignored for documents served as <code>application/ld+json</code>.</li>
+            HTTP Link Header is ignored for documents served as <code>application/ld+json</code> If
+            multiple HTTP Link Headers using the <code>http://www.w3.org/ns/json-ld#context</code>
+            link relation are found, the <i>promise</i> is rejected with a <a>JsonLdError</a> whose code is set to
+            <code class="error"><a href="#idl-def-JsonLdErrorCode.multiple-context-link-headers">multiple context link headers</a></code>
+            and processing is terminated.</li>
           <li>Set <i>expanded</i> to the result of using the
             <a href="#expansion-algorithm">Expansion algorithm</a>, passing the
             <tref>active context</tref> and <i>input</i> as <i>element</i>.</li>
@@ -4127,6 +4139,10 @@
           <tref>string</tref>.</dd>
         <dt>invalid local context</dt>
         <dd>In invalid <tref>local context</tref> was detected.</dd>
+        <dt>multiple context link headers</dt>
+        <dd>Multiple HTTP Link Headers [[!RFC5988]] using the
+          <code>http://www.w3.org/ns/json-ld#context</code> link relation
+          have been detected.</dd>
         <dt>loading remote context failed</dt>
         <dd>There was a problem encountered loading a remote context.</dd>
         <dt>invalid remote context</dt>
--- a/test-suite/idltest/index.html	Tue Jul 23 21:41:14 2013 +0200
+++ b/test-suite/idltest/index.html	Tue Jul 23 22:38:06 2013 +0200
@@ -63,6 +63,7 @@
     "conflicting indexes",
     "invalid @id value",
     "invalid local context",
+    "multiple context link headers",
     "loading remote context failed",
     "invalid remote context",
     "recursive context inclusion",