Closed Bug 285734 Opened 20 years ago Closed 20 years ago

XMLHttpRequest POST with body has wrong Content-Length

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 246651

People

(Reporter: hupfeld, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.6) Gecko/20050223 Firefox/1.0.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.7.6) Gecko/20050223 Firefox/1.0.1

XMLHttpRequest() with verb POST adds extraneous \r\n to end of body string
without accounting for it in the Content-Length header.

Reproducible: Always

Steps to Reproduce:
sendRESTRequest( '/', 'POST', 'test', null, null );

function sendRESTRequest( url, verb, body, handler, token ) 
{
    current_request_token = token;

    if( window.XMLHttpRequest ) 
        current_request = new XMLHttpRequest();
    else if( window.ActiveXObject) 
        current_request = new ActiveXObject("Microsoft.XMLHTTP");
    
    if( current_request )
    {      
        current_request.onreadystatechange = handler;
        current_request.open( verb, url, true );
        current_request.send( body );    
    }
}
Not a JavaScript Engine bug. -> Core/DOM Mozilla Extensions
Assignee: general → general
Component: JavaScript Engine → DOM: Mozilla Extensions
QA Contact: general → ian

*** This bug has been marked as a duplicate of 246651 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Component: DOM: Mozilla Extensions → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.