Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug in proxy setting #517

Open
LucaMingarelli opened this issue Jun 29, 2023 · 0 comments
Open

🐛 Bug in proxy setting #517

LucaMingarelli opened this issue Jun 29, 2023 · 0 comments

Comments

@LucaMingarelli
Copy link

LucaMingarelli commented Jun 29, 2023

https://github.com/cloudera/impyla/blob/c077bedb142cebdd266148b37f9888d04f730d14/impala/_thrift_api.py#L163C7-L163C38

This seems to be a bug

def basic_proxy_auth_header(proxy):
    if proxy is None or not proxy.username:
      return None
    ap = "%s:%s" % (urllib.parse.unquote(proxy.username),
                    urllib.parse.unquote(proxy.password))
    cr = base64.b64encode(ap).strip()
    return "Basic " + cr

ap here is a string hence base64.b64encode(ap) fails as it expects bytes (e.g. ap.encode()?)

Also not sure about the purpose of the strip on a byte object - it has no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant