Skip to content

Content-Length needs to be specdified for spydermonkey port #39

@julkiewicz

Description

@julkiewicz

The default implementation doesn't work appropriately for POST/PUT requests. The server receives an empty message body. There needs to be added 'Content-Length' parameter to the header of the request. I changed the code in envjs/platform/spydermonkey.js as follows:

if(data && (xhr.method == "PUT" || xhr.method == "POST" )) {
    if(data instanceof Document){
        data = (new XMLSerializer()).serializeToString(data);
    } else {
        data = data + ''
    }
    if(data.length&&data.length>0){
        connection.putheader('Content-Length', data.length);
        connection.endheaders(data);
    }else{
        connection.endheaders();
    }
}else{
    connection.endheaders();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions