Commit fce31e83 authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

URL-encode requests

parent 21d2194d
......@@ -31,6 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from urllib2 import quote
from threading import Thread
from json import dumps, loads
from time import time
......@@ -193,7 +194,7 @@ class Client(object):
sendlog.info('perform a %s @ %s', method, self.base_url)
self.http_client.url = self.base_url
self.http_client.path = path
self.http_client.path = quote(path)
r = self.http_client.perform_request(
method,
data,
......
# Copyright 2011-2012 GRNET S.A. All rights reserved.
# Copyright 2011-2013 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
......@@ -246,10 +246,9 @@ class PithosClient(PithosRestAPI):
offset += bytes
if hash_cb:
hash_gen.next()
if offset != size:
msg = 'Failed to calculate uploaded blocks:'
msg += ' Offset and object size do not match'
assert offset == size, msg
msg = 'Failed to calculate uploaded blocks:'
msg += ' Offset and object size do not match'
assert offset == size, msg
def _upload_missing_blocks(self, missing, hmap, fileobj, upload_gen=None):
"""upload missing blocks asynchronously"""
......
# Copyright 2011-2012 GRNET S.A. All rights reserved.
# Copyright 2012-2013 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment