Skip to content

Commit a9e5533

Browse files
phankiewiczlovelydinosaur
authored andcommitted
Add X-CSRFToken HTTP header in swagger-ui example (#6968)
1 parent 25ac7ba commit a9e5533

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/topics/documenting-your-api.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ this:
4545
SwaggerUIBundle.presets.apis,
4646
SwaggerUIBundle.SwaggerUIStandalonePreset
4747
],
48-
layout: "BaseLayout"
48+
layout: "BaseLayout",
49+
requestInterceptor: (request) => {
50+
request.headers['X-CSRFToken'] = "{{ csrf_token }}"
51+
return request;
52+
}
4953
})
5054
</script>
5155
</body>

0 commit comments

Comments
 (0)