Sha256: c323a0471ce06f74b13e5112d8ac29d4e2b01b168a3c53c1737091b1625f545c
Contents?: true
Size: 433 Bytes
Versions: 68
Compression:
Stored size: 433 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|javascript|css/) [404, { 'Content-Type' => 'application/hal+json'},[]] else response end end end end end
Version data entries
68 entries across 68 versions & 1 rubygems