Hi,

I think this also covers #2367, but I don't have a mongrel setup
under the hand to test.

Rationale:
when doing a save, the server uses the client Accept header to find the
serialization format of the given body.
This is wrong, because the client can use anything, even a format
that is not listed in Accept.
Accept is to be used by the server to encode the response object.
For incoming objects, HTTP should use the Content-Type header.

This patch adds Content-Type sending when saving objects.

The code is available in the tickets/master/2392 branch of
my github repository:

Please review and comment,
Thanks

Brice Figureau (1):
  Fix #2392 - make sure server unserialize with client format

 lib/puppet/indirector/rest.rb           |    2 +-
 lib/puppet/network/format_handler.rb    |    8 +++++++-
 lib/puppet/network/http/handler.rb      |   17 ++++++++++++++---
 lib/puppet/network/http/mongrel/rest.rb |    4 ++++
 lib/puppet/network/http/rack/rest.rb    |    5 +++++
 lib/puppet/network/http/webrick/rest.rb |    4 ++++
 spec/unit/indirector/rest.rb            |    9 ++++++++-
 spec/unit/network/format_handler.rb     |   26 ++++++++++++++++++++++++++
 spec/unit/network/http/handler.rb       |   26 ++++++++++++++++++--------
 spec/unit/network/http/mongrel/rest.rb  |    5 +++++
 spec/unit/network/http/rack/rest.rb     |    5 +++++
 spec/unit/network/http/webrick/rest.rb  |    5 +++++
 12 files changed, 102 insertions(+), 14 deletions(-)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to