Skip to content

Commit

Permalink
Merge pull request #166 from christopherpickering/patch-2
Browse files Browse the repository at this point in the history
add functions that were removed in werkszeug.
  • Loading branch information
viniciuschiele authored May 16, 2021
2 parents 7d3224f + 488cf5d commit df8e2c0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion flask_apscheduler/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,21 @@
import base64

from flask import request
from werkzeug.http import bytes_to_wsgi, wsgi_to_bytes


def wsgi_to_bytes(data):
"""coerce wsgi unicode represented bytes to real ones"""
if isinstance(data, bytes):
return data
return data.encode("latin1") # XXX: utf8 fallback?


def bytes_to_wsgi(data):
assert isinstance(data, bytes), "data must be bytes"
if isinstance(data, str):
return data
else:
return data.decode("latin1")


def get_authorization_header():
Expand Down

0 comments on commit df8e2c0

Please sign in to comment.