Add X-CSRFToken HTTP header in swagger-ui example (#6968)

This commit is contained in:
phankiewicz 2020-01-03 14:59:32 +01:00 committed by Tom Christie
parent 25ac7ba450
commit a9e55334e7

View File

@ -45,7 +45,11 @@ this:
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
],
layout: "BaseLayout"
layout: "BaseLayout",
requestInterceptor: (request) => {
request.headers['X-CSRFToken'] = "{{ csrf_token }}"
return request;
}
})
</script>
</body>