Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Unquote username & password when parsing a DSN #919

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions influxdb/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import requests
import requests.exceptions
from requests.adapters import HTTPAdapter
from six.moves.urllib.parse import urlparse
from six.moves.urllib.parse import urlparse, unquote

from influxdb.line_protocol import make_lines, quote_ident, quote_literal
from influxdb.resultset import ResultSet
Expand Down Expand Up @@ -1247,8 +1247,8 @@ def _parse_dsn(dsn):

def _parse_netloc(netloc):
info = urlparse("http://{0}".format(netloc))
return {'username': info.username or None,
'password': info.password or None,
return {'username': unquote(info.username) or None,
'password': unquote(info.password) or None,
'host': info.hostname or 'localhost',
'port': info.port or 8086}

Expand Down