Skip to content

Commit

Permalink
Serialize to string, do not bump ver
Browse files Browse the repository at this point in the history
  • Loading branch information
zuchmanski committed Aug 12, 2024
1 parent 3dcef9a commit a533033
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Changelog

## 8.0.0

- [#267](https://github.com/castle/castle-ruby/pull/267)
- filter out non-string header values
## master

**BREAKING CHANGES:**

Expand Down
3 changes: 1 addition & 2 deletions lib/castle/headers/filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ def call
.keys
.each_with_object({}) do |header_name, acc|
next unless header_name.match(VALUABLE_HEADERS)
next unless @request_env[header_name].is_a?(String)

formatted_name = @header_format.call(header_name)
acc[formatted_name] = @request_env[header_name]
acc[formatted_name] = @request_env[header_name].to_s
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/castle/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Castle
VERSION = '8.0.0'
VERSION = '7.2.0'
end
5 changes: 3 additions & 2 deletions spec/lib/castle/headers/filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@
'Ok' => 'OK',
'User-Agent' => 'Mozilla 1234',
'Remote-Addr' => '1.2.3.4',
'X-Forwarded-For' => '1.2.3.4'
'X-Forwarded-For' => '1.2.3.4',
'Accept-Language.parser' => start_with("#<Proc")
}
end
let(:request) { Rack::Request.new(env) }

context 'with list of header' do
it { expect(filter_call).to eq(filtered) }
it { expect(filter_call).to match(filtered) }
end
end

0 comments on commit a533033

Please sign in to comment.