diff options
author | Ib Lundgren <ib.lundgren@gmail.com> | 2012-11-17 12:39:43 +0100 |
---|---|---|
committer | Ib Lundgren <ib.lundgren@gmail.com> | 2012-11-17 12:39:43 +0100 |
commit | 15d98b0122db2c552d428eacbd38124a2b7e8675 (patch) | |
tree | 35fc5ceaa44e0ae533338a5484c86205c5b909ab /oauthlib/common.py | |
parent | 9c690b3904e68111bb39cf3e89e6914b09d5e6d2 (diff) | |
download | oauthlib-15d98b0122db2c552d428eacbd38124a2b7e8675.tar.gz |
Add params to fragment
Diffstat (limited to 'oauthlib/common.py')
-rw-r--r-- | oauthlib/common.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/oauthlib/common.py b/oauthlib/common.py index 1402e49..3febffa 100644 --- a/oauthlib/common.py +++ b/oauthlib/common.py @@ -209,12 +209,16 @@ def add_params_to_qs(query, params): return urlencode(queryparams) -def add_params_to_uri(uri, params): +def add_params_to_uri(uri, params, fragment=False): """Add a list of two-tuples to the uri query components.""" sch, net, path, par, query, fra = urlparse.urlparse(uri) - query = add_params_to_qs(query, params) + if fragment: + fra = add_params_to_qs(query, params) + else: + query = add_params_to_qs(query, params) return urlparse.urlunparse((sch, net, path, par, query, fra)) + def safe_string_equals(a, b): """ Near-constant time string comparison. |