Closed Bug 129329 Opened 23 years ago Closed 23 years ago

xml-rpc interface embeds additional Carriage Return & Line Feed's in RPC Request Body

Categories

(Core :: XML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: frodo.baggins5, Assigned: samuel)

Details

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7+) Gecko/20020116 BuildID: 20020307 In generating the XmlRpc Msg Request. An additional Carriage Return & Line Feed ('\r\n') is appended to the http header before the Xml Msg Body. After end of the http header instead of seeing 2 Carriage return/Line Feed combinations a third Carriage return/Line Feed combination is present. Also in between the "<?xml version ="1.0" encoding="ISO-8859-1"?>" and the "<methodCall>" an additional line feed is added. This is creating an interoperability problem with the xmlrpc-c library implementation. However, using other XmlRpc libraries it doesn't seem to be an issue Reproducible: Always Steps to Reproduce: 1.Start Up A Network Listener to print out the XML Request Stream 2.Initialize an xmlrpc object and send an XmlRpc Message 3.Examine the Xml Stream that is printed by the Network Listener Actual Results: The output data should be printed without 3 CR\LF combos after the HTTP Header and No additional line feed should be present inbetween the <?xml> and <methodCall> fields. Expected Results: The CR\LF and LF should not be present in the output Message Request Stream. Pending other reason's for not fixing it the following should fix nsXmlRpcClient.js remove the '\n' from the below line in function XMLWriter(): this.data = '<?xml version="1.0" encoding="ISO-8859-1"?>\n'; Inside of the _getChannel function remove the request="\r\n" + request; line
Samuel Sieb is the module owner of XML-RPC, reassigning.
Assignee: heikki → samuel
The extra cr/nl after the header should have been fixed a while ago. I'll take a look again. What's wrong with there being a blank line after the <?xml ?> tag? Isn't that valid?
Ok, My Apologies on the first one I checked the newest version in CVS and it has in fact been removed from the _getChannel function. As for the '\n' being valid in the XMLWriter() function. I can't say if it is speced in the XMLRPC specification document, but two other implementations the Apache XmlRpc implementation in java and the xmlrpc-c library do not produce the additional '\n' in this spot. This in fact does prevent a server implemented in xmlrpc-c from processing a request from a mozilla client. To be fair however the ApacheXmlRpc implementation process's that request correctly. For maximum portability it would seem to be good to leave the '\n' out of the request.
XML itself allows whitespace after the XML declaration, but if there is a service that has a bug and cannot handle it, I think it would be nice for us to not add the newline there. It is still valid XML, just not as nice to read for humans. But then again, this is being read by a machine so who cares...
Attached patch remove newlineSplinter Review
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: patch
OS: Windows 2000 → All
Hardware: PC → All
Comment on attachment 72912 [details] [diff] [review] remove newline rs=darin
Attachment #72912 - Flags: superreview+
Comment on attachment 72912 [details] [diff] [review] remove newline a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #72912 - Flags: approval+
checked in to trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: petersen → rakeshmishra
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: