raelgc / scudcloud

ScudCloud - Slack for Linux
https://launchpad.net/~rael-gc/+archive/ubuntu/scudcloud
MIT License
1.22k stars 99 forks source link

Support encoded characters in http_proxy #577

Closed nathanpw closed 7 years ago

nathanpw commented 7 years ago

Hi thanks for this great software. I am using this behind a proxy and have recently had to encode my user name and pass word in the http_proxy environment variable. Unfortunately scudcloud doesn't work when I do this. However, if I use the actual characters and not the url encoded values, it works as expected. I was wondering if you could implement the change at the bottom to support encoded urls in http_proxy?

ScudCloud Version

Paste the output for scudcloud --version below: ScudCloud 1.58 Python 3.5.2 Qt 5.5.1 PyQt 5.5.1 SIP 4.17

Distro and Desktop info

Expected behavior

Support encoded characters in the http_proxy environment variable.

Actual behavior

%XX encoded characters are not decoded and not sent to the proxy correctly.

Steps to reproduce

  1. Use a proxy that requires a username and password with url encoded characters
  2. Setup encoded characters in your http_proxy environment variable
  3. Run scudcloud

I was able to hack in the following changes in wrapper.py on line 44 below

def configure_proxy(self):

try: from urllib.parse import unquote except ImportError: from urllib import unquote url = os.environ.get('http_proxy') or os.environ.get('HTTP_PROXY') url_decode = unquote(url) proxy = urlparse(url_decode)

raelgc commented 7 years ago

Hi @nathanpw and thanks for this improvement.

Do you mind to create a pull request with it?

nathanpw commented 7 years ago

@raelgc, sure - https://github.com/raelgc/scudcloud/pull/578

raelgc commented 7 years ago

Thank you @nathanpw! Packages published for Ubuntu!