Add X-CSRFToken HTTP header in swagger-ui example

This commit is contained in:
Piotr Hankiewicz 2019-10-03 23:12:33 +02:00
parent 0dac98d215
commit aa817be298

View File

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