diff --git a/lib/rspec_api_documentation/dsl/endpoint.rb b/lib/rspec_api_documentation/dsl/endpoint.rb
index <HASH>..<HASH> 100644
--- a/lib/rspec_api_documentation/dsl/endpoint.rb
+++ b/lib/rspec_api_documentation/dsl/endpoint.rb
@@ -63,11 +63,11 @@ module RspecApiDocumentation::DSL
 
     def headers
       return unless example.metadata[:headers]
-      example.metadata[:headers].inject({}) do |hash, header|
-        if header[1].is_a?(Symbol)
-          hash[header[0]] = send(header[1]) if respond_to?(header[1])
+      example.metadata[:headers].inject({}) do |hash, (header, value)|
+        if value.is_a?(Symbol)
+          hash[header] = send(value) if respond_to?(value)
         else
-          hash[header[0]] = header[1]
+          hash[header] = value
         end
         hash
       end
Clean up the header inject to use |hash, (header, value)|