diff --git a/swift/common/middleware/formpost.py b/swift/common/middleware/formpost.py index 96024bd5d2..8ba5ddc51e 100644 --- a/swift/common/middleware/formpost.py +++ b/swift/common/middleware/formpost.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" +r""" FormPost Middleware Translates a browser form post into a regular Swift object PUT. @@ -86,7 +86,7 @@ sample code for computing the signature:: max_file_count = 10 expires = int(time() + 600) key = 'mykey' - hmac_body = '%s\\n%s\\n%s\\n%s\\n%s' % (path, redirect, + hmac_body = '%s\n%s\n%s\n%s\n%s' % (path, redirect, max_file_size, max_file_count, expires) signature = hmac.new(key, hmac_body, sha1).hexdigest() diff --git a/swift/common/middleware/tempurl.py b/swift/common/middleware/tempurl.py index cf140edcba..0f13fd8131 100644 --- a/swift/common/middleware/tempurl.py +++ b/swift/common/middleware/tempurl.py @@ -28,7 +28,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" +r""" TempURL Middleware Allows the creation of URLs to provide temporary access to objects. @@ -69,7 +69,7 @@ seconds on ``/v1/AUTH_account/container/object``:: expires = int(time() + 60) path = '/v1/AUTH_account/container/object' key = 'mykey' - hmac_body = '%s\\n%s\\n%s' % (method, expires, path) + hmac_body = '%s\n%s\n%s' % (method, expires, path) sig = hmac.new(key, hmac_body, sha1).hexdigest() Be certain to use the full path, from the ``/v1/`` onward.