Skip to content

Commit

Permalink
Merge pull request #85 from mark-adams/remove-header
Browse files Browse the repository at this point in the history
Removed `api.header`
  • Loading branch information
jpadilla committed Jan 25, 2015
2 parents d7fd8c3 + 77b806f commit f7a6b5f
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions jwt/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ def register_algorithm(alg_id, alg_obj):
_register_default_algorithms()


def header(jwt):
if isinstance(jwt, text_type):
jwt = jwt.encode('utf-8')
header_segment = jwt.split(b'.', 1)[0]
try:
header_data = base64url_decode(header_segment)
return json.loads(header_data.decode('utf-8'))
except (ValueError, TypeError):
raise DecodeError('Invalid header encoding')


def encode(payload, key, algorithm='HS256', headers=None, json_encoder=None):
segments = []

Expand Down

0 comments on commit f7a6b5f

Please sign in to comment.