django-rest-framework/rest_framework/templates/rest_framework
Jesse London 9c9ffb18f4
made Browsable API base template cachable: omit CSRF token when unnecessary (#7717)
HTML responses generated by the Browsable API otherwise generate
inconsistent ETAGs -- due to the presence of CSRF tokens in the response
-- even when the API is read-only, (and as such when the response
contains no resource-modifying forms, i.e. neither POST nor PUT forms,
which might require the CSRF token).

While the template was appropriately including CSRF tokens only within
POST and PUT forms, its AJAX overlay included the CSRF token in *every*
response, regardless of whether it would be needed.

This change brings the logic of the `script` block into line with that
of the rest of the template -- and such that read-only APIs (and really
the Browsable API pages of *any* read-only resources) will not
needlessly include the CSRF token, and will now be safely cachable -- by
both back-end systems and by the user agent.
2021-03-16 13:25:21 +00:00
..
admin Admin renderer urls (#5988) 2018-07-06 10:58:26 +02:00
docs Replace all url() calls with path() or re_path() (#7512) 2020-09-08 15:32:27 +01:00
filters Overlooked translation in search.html (#7551) 2021-03-09 10:21:11 +00:00
horizontal Made TemplateHTMLRenderer render IntegerField inputs when value is 0. (#5834) 2018-02-16 16:48:20 +01:00
inline Made TemplateHTMLRenderer render IntegerField inputs when value is 0. (#5834) 2018-02-16 16:48:20 +01:00
pagination Consistent 2 space tabbing and formatting 2015-06-18 09:00:05 -04:00
vertical Made TemplateHTMLRenderer render IntegerField inputs when value is 0. (#5834) 2018-02-16 16:48:20 +01:00
admin.html jquery 3.5.1 (#7313) 2020-05-11 13:08:40 +01:00
api.html Change package name: djangorestframework -> rest_framework 2012-09-20 13:06:27 +01:00
base.html made Browsable API base template cachable: omit CSRF token when unnecessary (#7717) 2021-03-16 13:25:21 +00:00
login_base.html Load 'static' instead of 'staticfiles' in templates (#5773) 2018-01-26 00:43:55 -05:00
login.html extend base login template 2013-04-17 10:15:02 -04:00
raw_data_form.html Change serializer field help_text rendering in browsable api (#3812) 2016-06-02 15:21:57 +01:00
schema.js Fallback to more widely supported JS feature sets. (#4961) 2017-03-10 12:07:15 +00:00