Skip to content

Object copy requires a "Content-Length: 0" in the request#2

Closed
asmajlovic wants to merge 2 commits intorackspace:masterfrom
asmajlovic:master
Closed

Object copy requires a "Content-Length: 0" in the request#2
asmajlovic wants to merge 2 commits intorackspace:masterfrom
asmajlovic:master

Conversation

@asmajlovic
Copy link
Copy Markdown

As per the RAX API docs for Cloud Files, object copy requests via a PUT need the content length specified to be zero:

http://docs.rackspace.com/files/api/v1/cf-devguide/content/Copy_Object-d1e2241.html

I have modified the relevant section to check only if the header has been defined and create the new dictionary if not. The content length is explicitly provided in an add call.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please fix the build error here. You are missing the ; at the end as well as you cannot put and int here, it needs to be a string.

headers.Add(ContentLength, "0");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing, I think there was a miss understanding with the docs. The docs do not require a "0" as the content-type, but instead it reads that it requires a content-type even if it is "0":

Also, the X-Copy-From PUT requests require a Content-Length header, even if it is zero (0).

So, with this pull request, it is forcing the content type to zero which is wrong. The way it was written should be sufficient.

@asmajlovic
Copy link
Copy Markdown
Author

Hopefully good to go now.

@asmajlovic
Copy link
Copy Markdown
Author

Being addressed through openstacknetsdk#86

@asmajlovic asmajlovic closed this May 9, 2013
@alanquillin
Copy link
Copy Markdown

@asmajlovic Sorry, i had pull requested to the wrong fork. This is actually being taken care of by: #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants