The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #4456

REST doesn't know synonyms for its mime types

Added by Jiří Kubíček over 3 years ago. Updated over 1 year ago.

Status:Code InsufficientStart date:08/03/2010
Priority:HighDue date:
Assignee:-% Done:

0%

Category:plumbing
Target version:-
Affected Puppet version: Branch:http://github.com/MarkusQ/puppet/tree/ticket/2.6.x/4456
Keywords:REST MIME YAML

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

One can request data from puppet via REST like:

curl -k -H “Accept: yaml” https://puppet.domain.com:8140/production/facts/server.domain.com

But IMHO there is no mime-type called yaml and puppet doesn’t honor yaml mime types and that causes problems for example with rest-client library, that uses standard mime format:

RestClient.get ‘https://puppet.domain.com:8140/production/facts/server.domain.com’, {:accept => :yaml} err: No specified acceptable formats (text/x-yaml) are functional on this machine

I think puppet should handle all types “application/x-yaml”, “application/yaml”, “text/x-yaml” and “text/yaml” as it currently does with “yaml”


Related issues

Related to Puppet - Bug #7294: Format encoding/decoding meta-bug for Faces, network, and... Accepted 04/29/2011

History

#1 Updated by James Turnbull over 3 years ago

  • Category set to plumbing
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Luke Kanies

#2 Updated by Luke Kanies over 3 years ago

  • Status changed from Needs Decision to Accepted
  • Assignee deleted (Luke Kanies)
  • Priority changed from Normal to High

#3 Updated by Markus Roberts over 3 years ago

  • Assignee set to Markus Roberts

I suspect we may have the same issue with JSON/PSON and perhaps others.

#4 Updated by Markus Roberts over 3 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Branch set to http://github.com/MarkusQ/puppet/tree/ticket/2.6.x/4456

#5 Updated by Markus Roberts over 3 years ago

  • Subject changed from REST doesn't honor requested mime types to REST doesn't know synonyms for its mime types

#6 Updated by Markus Roberts over 3 years ago

  • Status changed from In Topic Branch Pending Review to Closed

Merged as commit:81a27251f9052337ae9e66962a2a1f670e803a50

#7 Updated by Paul Berry over 3 years ago

  • Status changed from Closed to Re-opened

I’ve just been looking into this code, and discovered that the patch only addresses part of the problem:

  • It only addresses PUT requests, not GET requests.

  • Due to the fact that formats are stored in a hash whose key is the format’s name, the patch isn’t having the intended effect on PUT requests either. Each successive MIME handler that we try to install for a given format overwrites the previous, so as a result we only support the MIME types of the form text/#{name}. We don’t support application/x-#{name}, application/#{name}, or text/x-#{name}.

#8 Updated by James Turnbull over 3 years ago

  • Target version set to 2.6.5

#9 Updated by Nigel Kersten about 3 years ago

  • Target version changed from 2.6.5 to 2.6.x

#10 Updated by James Turnbull about 3 years ago

  • Target version changed from 2.6.x to 2.6.6

#11 Updated by James Turnbull about 3 years ago

  • Target version changed from 2.6.6 to 2.6.x

#12 Updated by Nigel Kersten about 3 years ago

  • Target version changed from 2.6.x to 2.7.x

#13 Updated by James Turnbull over 2 years ago

  • Status changed from Re-opened to Needs Decision
  • Assignee changed from Markus Roberts to Nigel Kersten

#14 Updated by Nigel Kersten over 2 years ago

  • Status changed from Needs Decision to Code Insufficient
  • Assignee deleted (Nigel Kersten)

We do want to do this.

#15 Updated by Andrew Parker over 1 year ago

  • Target version deleted (2.7.x)

Also available in: Atom PDF