Start a Conversation

Unsolved

This post is more than 5 years old

3389

July 14th, 2009 07:00

What is the right way to create objects with non "URL-friendly" characters, such as spaces, using the namespace interface and the REST API?

For example, if I want to create a file named "/dir/file with spaces", I found that:

- doing a "POST /rest/namespace/dir/file with spaces" doesn't work;

- doing a "POST /rest/namespace/dir/file%20with%20spaces" and using "/rest/namespace/dir/file%20with%20spaces" as the canonicalized resource for authentication returns a signature mismatch error;

- doing a "POST /rest/namespace/dir/file%20with%20spaces" and using "/rest/namespace/dir/file with spaces" as the canonicalized resource for authentication (the URL is encoded, but not for authentication), the call succeeds, but the file is created as "file%20with%20spaces", and not as "file with spaces", as I believe it should.

Thanks,
Luis

49 Posts

July 20th, 2009 14:00

Good catch, Luis. Can you file this in the feedback section of the portal please? Many thanks. - Leo

14 Posts

July 22nd, 2009 12:00

Just filed it.

Thanks!

222 Posts

July 31st, 2009 08:00

Luis,

Try using a plus sign (+) where a space is otherwise required in the request header.  Illegal characters such as the percent symbol or a question mark will cause signature mismatch errors.

Raj

14 Posts

August 3rd, 2009 07:00

Hi Raj,

I'll give it a try, but what about other possible problematic characters, such as '&'?

When calculating the signature for the authentication, I can even use normal spaces (' ') instead of its encoded value ("%20"), so my guess is that two things in Atmos would have to be changed to permanently address this issue:

- the code for the namespace interface would have to decode the URL, taking care of characters encoded with %XX;

- it would be nice if the signature verification code accepted the same set of characters as the real request URL, so callers could use the same string for both, and not having to worry about keeping an encoded and an unencoded version.

Do you think that would make sense?

Thanks,

Luis

14 Posts

August 5th, 2009 06:00

Raj,

I tried with '+' instead of ' ', and it really doesn't do the right thing. Just like the case where I used '%20' in the request URL and ' ' in the url used when calculating the signature, the operation succeeds, but the object is created with the wrong name - in this case, it was created as "/test+dir", and not "/test dir".

Thanks,

Luis

222 Posts

August 7th, 2009 11:00

Luis,

Apologies for the delayed response.  I did get to the bottom of this though.

There was a bug related to using special characters that was fixed, but it hasn't been deployed to Atmos Online yet.

The last update to Atmos Online was released just before the bug was fixed.

I'm attempting to get an estimate as to when this might be applied to Atmos Online.  I'll let you know ASAP.


Raj

No Events found!

Top