Skip to content

Commit

Permalink
Apparently DELETE also needs a Content-Length
Browse files Browse the repository at this point in the history
  • Loading branch information
Amos Wenger committed Dec 5, 2011
1 parent baf1b4b commit d077cb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion httpzmq.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down
2 changes: 1 addition & 1 deletion httpzmq.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d077cb5

Please sign in to comment.