Sha256: 7c60c58882262f8052b5eeafd51370f49c7e590834d431eb6a5940c8ed9f4e27
Contents?: true
Size: 447 Bytes
Versions: 35
Compression:
Stored size: 447 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;charset=utf-8"},[]] else response end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems