Skip to content

Commit

Permalink
Fix CI for rack 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py committed Jun 24, 2024
1 parent 389395e commit 57b6fd9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sentry-ruby/spec/sentry/interfaces/request_interface_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
return unless defined?(Rack)

require 'spec_helper'

return unless defined?(Rack)

RSpec.describe Sentry::RequestInterface do
let(:env) { Rack::MockRequest.env_for("/test") }
let(:send_default_pii) { false }
Expand Down Expand Up @@ -44,14 +44,16 @@
let(:env) { Rack::MockRequest.env_for("/test", additional_headers) }

it 'transforms headers to conform with the interface' do
expect(subject.headers).to eq("Content-Length" => "0", "Version" => "HTTP/1.1", "X-Request-Id" => "12345678")
expect(subject.headers).to include("Version" => "HTTP/1.1", "X-Request-Id" => "12345678")
expect(subject.headers).not_to include("Cookie")
end

context 'from Rails middleware' do
let(:additional_headers) { { "action_dispatch.request_id" => "12345678" } }

it 'transforms headers to conform with the interface' do
expect(subject.headers).to eq("Content-Length" => "0", "X-Request-Id" => "12345678")
expect(subject.headers).to include("X-Request-Id" => "12345678")
expect(subject.headers).not_to include("Cookie")
end
end

Expand All @@ -61,7 +63,7 @@
it "doesn't cause any issue" do
json = JSON.generate(subject.to_hash)

expect(JSON.parse(json)["headers"]).to eq({ "Content-Length"=>"0", "Foo"=>"Tekirda�" })
expect(JSON.parse(json)["headers"]).to include("Foo"=>"Tekirda�")
end
end

Expand Down

0 comments on commit 57b6fd9

Please sign in to comment.