Skip to content

Commit cfc2570

Browse files
authored
Fix CI for rack 3.1 (#2327)
1 parent 389395e commit cfc2570

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

Gemfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ ruby_version = Gem::Version.new(RUBY_VERSION)
99
if ruby_version >= Gem::Version.new("2.7.0")
1010
gem "debug", github: "ruby/debug", platform: :ruby
1111
gem "irb"
12-
13-
if ruby_version >= Gem::Version.new("3.0.0")
14-
gem "ruby-lsp-rspec"
15-
end
12+
gem "ruby-lsp-rspec" if ruby_version >= Gem::Version.new("3.0.0") && RUBY_PLATFORM != "java"
1613
end
1714

1815
# For RSpec

sentry-ruby/spec/sentry/interfaces/request_interface_spec.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
return unless defined?(Rack)
2-
31
require 'spec_helper'
42

3+
return unless defined?(Rack)
4+
55
RSpec.describe Sentry::RequestInterface do
66
let(:env) { Rack::MockRequest.env_for("/test") }
77
let(:send_default_pii) { false }
@@ -44,14 +44,16 @@
4444
let(:env) { Rack::MockRequest.env_for("/test", additional_headers) }
4545

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

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

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

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

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

0 commit comments

Comments
 (0)