Skip to content

Commit e4bd4cf

Browse files
authored
Merge pull request #349 from njiuko/fix_integer_as_header_value
Fix integer as header value
2 parents 9201f69 + 52fffd8 commit e4bd4cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/rspec_api_documentation/curl.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ def format_header(header)
6969
end
7070

7171
def format_full_header(header, value)
72-
formatted_value = value ? value.gsub(/"/, "\\\"") : ''
72+
formatted_value = if value.is_a?(Numeric)
73+
value
74+
else
75+
value ? value.gsub(/"/, "\\\"") : ''
76+
end
77+
7378
"#{format_header(header)}: #{formatted_value}"
7479
end
7580

0 commit comments

Comments
 (0)