def extract_headers(request):
    """
    Extracts headers from the Django request object
    :param request: The current django.http.HttpRequest object
    :return: a dictionary with OAuthLib needed headers
    """
    headers = request.META.copy()
    if "wsgi.input" in headers:
        del headers["wsgi.input"]
    if "wsgi.errors" in headers:
        del headers["wsgi.errors"]
    if "HTTP_AUTHORIZATION" in headers:
        headers["Authorization"] = headers["HTTP_AUTHORIZATION"]

    return headers