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
<p>Sobrescribir ciertas cabeceras, permitir el uso de cualquier cabecera sin restricción o no especificar las cabeceras obligatorias puede causar vulnerabilidades en la API.</p>
3
+
<h2>Ejemplo de código no compatible (OpenAPI 2)</h2>
4
+
<pre>
5
+
swagger: "2.0"
6
+
info:
7
+
version: 1.0.0
8
+
title: Swagger Petstore
9
+
paths:
10
+
/pets:
11
+
get:
12
+
responses:
13
+
200:
14
+
description: Ok
15
+
headers:
16
+
Authorization: <spanclass="error-info" style="color: #FD8E18;"># Noncompliant {{OAR033: Header not allowed}}</span>
17
+
description: Forbidden header
18
+
schema:
19
+
type: string
20
+
</pre>
21
+
<h2>Solución compatible (OpenAPI 2)</h2>
22
+
<pre>
23
+
swagger: "2.0"
24
+
info:
25
+
version: 1.0.0
26
+
title: Swagger Petstore
27
+
paths:
28
+
/pets:
29
+
get:
30
+
responses:
31
+
200:
32
+
description: Ok
33
+
headers:
34
+
x-api-key:
35
+
description: Mandatory header
36
+
schema:
37
+
type: string
38
+
traceId:
39
+
description: Optional but allowed
40
+
schema:
41
+
type: string
42
+
</pre>
43
+
<h2>Ejemplo de código no compatible (OpenAPI 3)</h2>
44
+
<pre>
45
+
openapi: "3.0.0"
46
+
info:
47
+
version: 1.0.0
48
+
title: Swagger Petstore
49
+
paths:
50
+
/pets:
51
+
get:
52
+
responses:
53
+
200:
54
+
description: Ok
55
+
headers:
56
+
Authorization: <spanclass="error-info" style="color: #FD8E18;"># Noncompliant {{OAR033: Header not allowed}}</span>
0 commit comments