Page MenuHomePhabricator
Paste P7150

Puppet MIME validation

Authored by Krenair on May 24 2018, 10:53 PM.
$ irb
irb(main):001:0> require 'puppet'
=> true
irb(main):002:0> require 'puppet/network/format_support'
=> false
irb(main):003:0> Puppet::Network::FormatHandler.format_to_canonical_name('application/json')
ArgumentError: No format match the given format name or mime-type (application/json)
from /usr/lib/ruby/vendor_ruby/puppet/network/format_handler.rb:65:in `format_to_canonical_name'
from (irb):3
from /usr/bin/irb:11:in `<main>'
irb(main):004:0> Puppet::Network::FormatHandler.format_to_canonical_name('text/pson')
=> :pson

Event Timeline

Krenair created this paste.May 24 2018, 10:53 PM
Krenair updated the paste's language from ruby to autodetect.