Skip to content

Commit f2d0ebe

Browse files
authored
Fix TYP header documentation (#1046)
1 parent 24b0ba5 commit f2d0ebe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/usage.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ Specifying Additional Headers
102102
'eyJhbGciOiJIUzI1NiIsImtpZCI6IjIzMDQ5ODE1MWMyMTRiNzg4ZGQ5N2YyMmI4NTQxMGE1IiwidHlwIjoiSldUIn0.eyJzb21lIjoicGF5bG9hZCJ9.0n16c-shKKnw6gervyk1Dge35tvzbzQ_KCV3H3bgoJ0'
103103
104104
105+
By default the ``typ`` is attaching to the headers. In case when you don't need to pass this header to the token, you have to explicitly null it.
106+
107+
.. code-block:: pycon
108+
109+
>>> jwt.encode(
110+
... {"some": "payload"},
111+
... "secret",
112+
... algorithm="HS256",
113+
... headers={"typ": None},
114+
... )
115+
116+
105117
Reading the Claimset without Validation
106118
---------------------------------------
107119

0 commit comments

Comments
 (0)