Closed Jonovono closed 10 years ago
To fix I had to add: setHeader(options.headers, 'Content-Length', Buffer.byteLength(options.body));
in awssum.js
RIght, I dropped the following into line 956 of awssum.js. Not sure if this will break other things, though...
if (options.body){
options.headers['content-length'] = options.body.length;
}
Ok cool, thanks. I'll make sure that that gets set in the config.js related to that operation so that it's not in awssum.js (ie. you're right, not everything needs that, but easy enough for me to add to the config).
:)
Cheers, Andy
Yeah, if it wasn't obvious, it definitely is not safe to put that line in awssum.js. It breaks S3 uploads, for example, that have precomputed Content-Length headers. It also disables chunked encoding.
So what is the fix for this? Are you going to put this into config.js or shoudl I just continue with the hack in awssum.js
I have been using the awssum amazon cloudsearch api for awhile. Just recently I started getting a 411 error when adding a document.
Here is a pastebin: http://pastebin.com/tBrvMWU2
Sometimes I get 411 or 400. It used to work but for some reason just recently stopped and I can't figure out why.
This was the original code I used: https://github.com/Jonovono/node-awssum/blob/master/lib/amazon/cloudsearch.js