Skip to content

Commit

Permalink
Merge pull request #349 from njiuko/fix_integer_as_header_value
Browse files Browse the repository at this point in the history
Fix integer as header value
  • Loading branch information
oestrich authored Sep 27, 2017
2 parents 9201f69 + 52fffd8 commit e4bd4cf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/rspec_api_documentation/curl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ def format_header(header)
end

def format_full_header(header, value)
formatted_value = value ? value.gsub(/"/, "\\\"") : ''
formatted_value = if value.is_a?(Numeric)
value
else
value ? value.gsub(/"/, "\\\"") : ''
end

"#{format_header(header)}: #{formatted_value}"
end

Expand Down

0 comments on commit e4bd4cf

Please sign in to comment.