Sha256: 49c971237a5428316f0da886ff3864962e621d6679286ab4b0b1f023396ac4e8
Contents?: true
Size: 418 Bytes
Versions: 6
Compression:
Stored size: 418 Bytes
Contents
module Rack module PactBroker class Convert404ToHal def initialize app @app = app end def call env response = @app.call(env) if response.first == 404 && response[1]['Content-Type'] == 'text/html' && !(env['HTTP_ACCEPT'] =~ /html/) [404, { 'Content-Type' => 'application/hal+json'},[]] else response end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems