Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sending Content-Type on requests #221

Closed
wants to merge 1 commit into from

Conversation

maxlinc
Copy link
Contributor

@maxlinc maxlinc commented Nov 12, 2013

You find interesting things while intercepting via proxies...

php-opencloud is sending Content-Type on authentication (see here), but not on other services.

I guess OpenRepose is being lenient and assuming JSON rather than XML. It is more correct (and less likely to cause problems with proxies or other middleware) if you send the Content-Type, though.

I don't think this PR covers all the necessary posts. Does each post need to be changed, or is it possible to change in the HTTP client?

@jamiehannaford
Copy link
Contributor

@maxlinc The problem is with file uploads, i.e. Swift object transfers. Many people will not manually set a content-type - so the SDK will have to guess. We've done this before and the majority of times it got the file MIME type wrong. If you leave it blank, the API will do the content guessing for you - and do a much better job. What I can look at doing, however, is setting the Content-Type header for all other requests that contain a JSON body.

@jamiehannaford
Copy link
Contributor

This is hopefully fixed now. I'll reference this issue in a commit.

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

Successfully merging this pull request may close these issues.

None yet

2 participants