mirage 3.0.7 → 3.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/HISTORY +2 -0
- data/VERSION +1 -1
- data/mirage.gemspec +1 -1
- data/server/helpers/http_headers.rb +2 -1
- data/spec/server/helpers/http_headers_spec.rb +7 -0
- metadata +2 -2
data/HISTORY
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
V3.0.8 - bug fix for issue 13: https://github.com/lashd/mirage/issues/13 - match Content-Length header
|
2
|
+
V3.0.7 - bug fix for issue 13: https://github.com/lashd/mirage/issues/13 - match Content-Type header
|
1
3
|
V3.0.6 - bug fix
|
2
4
|
V3.0.5 - fixed bug in builder methods
|
3
5
|
V3.0.1 - updating gem post install message to point people towards the readme due checkout the differences between version 2 and 3 of Mirage
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.8
|
data/mirage.gemspec
CHANGED
@@ -4,9 +4,10 @@ module Mirage
|
|
4
4
|
class Server < Sinatra::Base
|
5
5
|
module Helpers
|
6
6
|
module HttpHeaders
|
7
|
+
HTTP_HEADER_FILTER_EXCEPTIONS = %w(CONTENT_TYPE CONTENT_LENGTH)
|
7
8
|
def extract_http_headers(env)
|
8
9
|
headers = env.reject do |k, v|
|
9
|
-
k.to_s.upcase
|
10
|
+
!HTTP_HEADER_FILTER_EXCEPTIONS.include?(k.to_s.upcase) && (!(/^HTTP_[A-Z_]+$/ === k) || v.nil?)
|
10
11
|
end.map do |k, v|
|
11
12
|
[reconstruct_header_name(k), v]
|
12
13
|
end.inject(Rack::Utils::HeaderHash.new) do |hash, k_v|
|
@@ -9,5 +9,12 @@ describe Mirage::Server::Helpers::HttpHeaders do
|
|
9
9
|
expect(helpers.extract_http_headers(expected)['Content-Type']).to eq('application/json')
|
10
10
|
end
|
11
11
|
|
12
|
+
it 'returns content-length' do
|
13
|
+
helpers = Object.new
|
14
|
+
helpers.extend(described_class)
|
15
|
+
expected = {'CONTENT_LENGTH' => '10'}
|
16
|
+
expect(helpers.extract_http_headers(expected)['Content-Length']).to eq('10')
|
17
|
+
end
|
18
|
+
|
12
19
|
end
|
13
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mirage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -343,7 +343,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
343
343
|
version: '0'
|
344
344
|
segments:
|
345
345
|
- 0
|
346
|
-
hash:
|
346
|
+
hash: -4163237484916477416
|
347
347
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
348
348
|
none: false
|
349
349
|
requirements:
|