Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
julkiewicz opened this issue Jun 11, 2011 · 0 comments
Open

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

julkiewicz opened this issue Jun 11, 2011 · 0 comments

Comments

@julkiewicz
Copy link

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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant