Permalink
Browse files

Apparently DELETE also needs a Content-Length

  • Loading branch information...
1 parent baf1b4b commit d077cb533532d0f50e0969483b8eb44fb783a89b Amos Wenger committed Dec 5, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 httpzmq.coffee
  2. +1 −1 httpzmq.js
View
@@ -6,7 +6,7 @@ PORT = 23479
socket.bindSync('tcp://*:' + PORT)
socket.on 'message', (data) ->
options = JSON.parse data.toString('utf8')
- if options.method == 'POST' || options.method == 'PUT'
+ if options.method == 'POST' || options.method == 'PUT' || options.method == 'DELETE'
options.headers['Content-Length'] = 0 # so.. only empty POST requests for now?
console.log 'Request: ', options
req = http.request options, (result) ->
View
@@ -14,7 +14,7 @@
socket.on('message', function(data) {
var options, req;
options = JSON.parse(data.toString('utf8'));
- if (options.method === 'POST' || options.method === 'PUT') {
+ if (options.method === 'POST' || options.method === 'PUT' || options.method === 'DELETE') {
options.headers['Content-Length'] = 0;
}
console.log('Request: ', options);

0 comments on commit d077cb5

Please sign in to comment.