File tree Expand file tree Collapse file tree 3 files changed +1
-14
lines changed Expand file tree Collapse file tree 3 files changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ module Headers
20
20
HTTP_TRANSFER_ENCODING = 'HTTP_TRANSFER_ENCODING' . freeze
21
21
HTTP_ACCEPT = 'HTTP_ACCEPT' . freeze
22
22
23
- ACCEPT = 'accept' . freeze
24
23
FORMAT = 'format' . freeze
25
24
end
26
25
end
Original file line number Diff line number Diff line change @@ -11,13 +11,6 @@ def default_options
11
11
}
12
12
end
13
13
14
- def headers
15
- env . dup . inject ( { } ) do |h , ( k , v ) |
16
- h [ k . to_s . downcase [ 5 ..-1 ] ] = v if k . to_s . downcase . start_with? ( 'http_' )
17
- h
18
- end
19
- end
20
-
21
14
def before
22
15
negotiate_content_type
23
16
read_body_input
@@ -133,7 +126,7 @@ def format_from_header
133
126
end
134
127
135
128
def mime_array
136
- accept = headers [ Grape ::Http ::Headers ::ACCEPT ]
129
+ accept = env [ Grape ::Http ::Headers ::HTTP_ACCEPT ]
137
130
return [ ] unless accept
138
131
139
132
accept_into_mime_and_quality = %r{
Original file line number Diff line number Diff line change @@ -110,11 +110,6 @@ def to_xml
110
110
expect ( subject . env [ 'api.format' ] ) . to eq ( :xml )
111
111
end
112
112
113
- it 'looks for case-indifferent headers' do
114
- subject . call ( 'PATH_INFO' => '/info' , 'http_accept' => 'application/xml' )
115
- expect ( subject . env [ 'api.format' ] ) . to eq ( :xml )
116
- end
117
-
118
113
it 'uses quality rankings to determine formats' do
119
114
subject . call ( 'PATH_INFO' => '/info' , 'HTTP_ACCEPT' => 'application/json; q=0.3,application/xml; q=1.0' )
120
115
expect ( subject . env [ 'api.format' ] ) . to eq ( :xml )
You can’t perform that action at this time.
0 commit comments