Commit 929e795aba1c09a217a1a755fd8ed70c39f793dd

Authored by Dave Miller
1 parent 88004758
Exists in master and in 1 other branch production

Treat request URL as CDATA so query string params don't result in invalid XML

public/javascripts/notifier.js
... ... @@ -506,7 +506,7 @@ printStackTrace.implementation.prototype = {
506 506 '<backtrace>{backtrace_lines}</backtrace>' +
507 507 '</error>' +
508 508 '<request>' +
509   - '<url>{request_url}</url>' +
  509 + '<url><![CDATA[{request_url}]]></url>' +
510 510 '<component>{request_component}</component>' +
511 511 '<action>{request_action}</action>' +
512 512 '{request}' +
... ...
spec/fixtures/hoptoad_test_notice.xml
... ... @@ -87,7 +87,7 @@
87 87 </backtrace>
88 88 </error>
89 89 <request>
90   - <url>http://example.org/verify</url>
  90 + <url><![CDATA[http://example.org/verify/cupcake=fistfight&lovebird=doomsayer]]></url>
91 91 <component>application</component>
92 92 <action>verify</action>
93 93 <params>
... ...
spec/models/error_report_spec.rb
... ... @@ -84,7 +84,7 @@ describe ErrorReport do
84 84 end
85 85  
86 86 it 'has request' do
87   - subject.request['url'].should == 'http://example.org/verify'
  87 + subject.request['url'].should == 'http://example.org/verify/cupcake=fistfight&lovebird=doomsayer'
88 88 subject.request['params']['controller'].should == 'application'
89 89 end
90 90  
... ...