Sha256: eff468d207232a9f14c33109e8a836d11dca5a481c0ddc547ac38c1838f84159
Contents?: true
Size: 776 Bytes
Versions: 53
Compression:
Stored size: 776 Bytes
Contents
require "spec_helper" describe Pliny::Middleware::RequestID do def app Rack::Builder.new do use Rack::Lint use Pliny::Middleware::RequestID run Sinatra.new { get "/" do env["REQUEST_IDS"].join(",") end } end end it "tags responses with Request-Id" do get "/" assert_match Pliny::Middleware::RequestID::UUID_PATTERN, last_response.headers["Request-Id"] end it "accepts incoming request IDs" do id = SecureRandom.uuid header "Request-Id", id get "/" assert_includes last_response.body, id end it "accepts incoming request IDs with an `X-` prefix" do id = SecureRandom.uuid header "X-Request-Id", id get "/" assert_includes last_response.body, id end end
Version data entries
53 entries across 53 versions & 1 rubygems