mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-03-30 06:44:27 +03:00
Add X-CSRFToken HTTP header in swagger-ui example (#6968)
This commit is contained in:
parent
25ac7ba450
commit
a9e55334e7
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user