File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
lib/rspec_api_documentation Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def format_header(header)
6969 end
7070
7171 def format_full_header ( header , value )
72- formatted_value = value . gsub ( /"/ , "\\ \" " )
72+ formatted_value = value ? value . gsub ( /"/ , "\\ \" " ) : ''
7373 "#{ format_header ( header ) } : #{ formatted_value } "
7474 end
7575
Original file line number Diff line number Diff line change 1515 "HTTP_X_HEADER" => "header" ,
1616 "HTTP_AUTHORIZATION" => %{Token token="mytoken"} ,
1717 "HTTP_HOST" => "example.org" ,
18- "HTTP_COOKIES" => ""
18+ "HTTP_COOKIES" => "" ,
19+ "HTTP_SERVER" => nil
1920 }
2021 end
2122
2627 it { should =~ /-H "Accept: application\/ json"/ }
2728 it { should =~ /-H "X-Header: header"/ }
2829 it { should =~ /-H "Authorization: Token token=\\ "mytoken\\ ""/ }
30+ it { should =~ /-H "Server: "/ }
2931 it { should_not =~ /-H "Host: example\. org"/ }
3032 it { should_not =~ /-H "Cookies: "/ }
3133
You can’t perform that action at this time.
0 commit comments