Skip to content

Commit

Permalink
Fix #1792: Lowercase all cookie keys, actually allow overriding the s…
Browse files Browse the repository at this point in the history
…amesite value
  • Loading branch information
matthiask committed Jun 5, 2023
1 parent 3e6e1df commit 3b87b93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions debug_toolbar/static/debug_toolbar/js/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ const djdt = {
options.path ? "; path=" + options.path : "",
options.domain ? "; domain=" + options.domain : "",
options.secure ? "; secure" : "",
"sameSite" in options
? "; sameSite=" + options.samesite
: "; sameSite=Lax",
"samesite" in options
? "; samesite=" + options.samesite
: "; samesite=lax",
].join("");

return value;
Expand Down
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Pending
* Adjusted app directories system check to allow for nested template loaders.
* Switched from flake8, isort and pyupgrade to `ruff
<https://beta.ruff.rs/>`__.
* Converted cookie keys to lowercase. Fixed the ``samesite`` argument to
``djdt.cookie.set``.

4.1.0 (2023-05-15)
------------------
Expand Down
4 changes: 3 additions & 1 deletion docs/panels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ common methods available.
:param value: The value to be set.

:param options: The options for the value to be set. It should contain the
properties ``expires`` and ``path``.
properties ``expires`` and ``path``. The properties ``domain``,
``secure`` and ``samesite`` are also supported. ``samesite`` defaults
to ``lax`` if not provided.

.. js:function:: djdt.hide_toolbar

Expand Down

0 comments on commit 3b87b93

Please sign in to comment.