Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1792: Lowercase all cookie keys, actually allow overriding the samesite value #1793

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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