summaryrefslogtreecommitdiff
path: root/jwt/api_jwt.py
diff options
context:
space:
mode:
Diffstat (limited to 'jwt/api_jwt.py')
-rw-r--r--jwt/api_jwt.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py
index e1df3c7..5d21afc 100644
--- a/jwt/api_jwt.py
+++ b/jwt/api_jwt.py
@@ -45,6 +45,7 @@ class PyJWT:
algorithm: Optional[str] = "HS256",
headers: Optional[Dict[str, Any]] = None,
json_encoder: Optional[Type[json.JSONEncoder]] = None,
+ sort_headers: bool = True,
) -> str:
# Check that we get a mapping
if not isinstance(payload, Mapping):
@@ -66,7 +67,14 @@ class PyJWT:
json_encoder=json_encoder,
)
- return api_jws.encode(json_payload, key, algorithm, headers, json_encoder)
+ return api_jws.encode(
+ json_payload,
+ key,
+ algorithm,
+ headers,
+ json_encoder,
+ sort_headers=sort_headers,
+ )
def _encode_payload(
self,