You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verduidelijk gebruik van CORS header in combinatie met openapi.json
(#245)
Hiermee makene we duidelijk dat de CORS regel is geschreven per
resource in plaats van per API. Daarmee kunnen we expliciet maken
dat de `openapi.json` resource bijvoorbeeld publiekelijk beschikbaar
moet zijn.
Ook voegen we een noot toe die omissie van de header expliciet maakt
als de resource enkel door de eigen origin wordt gebruikt.
Copy file name to clipboardExpand all lines: sections/designRules.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -829,7 +829,7 @@ For outbound filtering, the main concern is leaking of information.
829
829
</tr>
830
830
<tr>
831
831
<td>`Access-Control-Allow-Origin`</td>
832
-
<td>To relax the 'same origin' policy and allow cross-origin access. See CORS-policy below</td>
832
+
<td>To relax the 'same origin' policy and allow cross-origin access. See <a href="#/core/transport/cors">/core/transport/cors</a> for more information.</td>
833
833
</tr>
834
834
</tbody>
835
835
</table>
@@ -871,12 +871,22 @@ For outbound filtering, the main concern is leaking of information.
871
871
<dl>
872
872
<dt>Statement</dt>
873
873
<dd>
874
-
Use CORS to restrict access from other domains (if applicable).
874
+
Use CORS to restrict access from other domains for applicable resources
875
875
</dd>
876
876
<dt>Rationale</dt>
877
877
<dd>
878
-
<p>Modern web browsers use Cross-Origin Resource Sharing (CORS) to minimize the risk associated with cross-site HTTP-requests. By default browsers only allow 'same origin' access to resources. This means that responses on requests to another `[scheme]://[hostname]:[port]` than the `Origin` request header of the initial request will not be processed by the browser. To enable cross-site requests APIs can return a `Access-Control-Allow-Origin` response header. An allowlist SHOULD be used to determine the validity of different cross-site requests. To do this check the `Origin` header of the incoming request and check if the domain in this header is on the allowlist. If this is the case, set the incoming `Origin` header in the `Access-Control-Allow-Origin` response header.
879
-
<p>Using a wildcard `*` in the `Access-Control-Allow-Origin` response header is NOT RECOMMENDED, because it disables CORS-security measures. Only for an open API which has to be accessed by numerous other websites this is appropriate.
878
+
<p>Different resources can have different uses, as some resources are publicly available whereas others are restricted to several domains.
879
+
Modern web browsers use Cross-Origin Resource Sharing (CORS) to minimize the risk associated with cross-site HTTP-requests.
880
+
<p>By default browsers only allow 'same origin' access to resources.
881
+
This means that responses on requests to another `[scheme]://[hostname]:[port]` than the `Origin` request header of the initial request will not be processed by the browser.
882
+
To enable cross-site requests APIs can return a `Access-Control-Allow-Origin` response header.
883
+
<p>An allowlist SHOULD be used to determine the validity of different cross-site requests.
884
+
To do this, check the `Origin` header of the incoming request and check if the domain in this header is on the allowlist.
885
+
If this is the case, set the incoming `Origin` header in the `Access-Control-Allow-Origin` response header.
886
+
<div class="note">
887
+
Using a wildcard `*` in the `Access-Control-Allow-Origin` response header is NOT RECOMMENDED, because it disables CORS-security measures.
888
+
However, if the resource has to be accessed by numerous other origins that are not known up front (such as all resources in an open API, or the `openapi.json` as required by <a href="#/core/publish-openapi">/core/publish-openapi</a>), you MAY use `*`.
0 commit comments