Skip to content

Commit

Permalink
case sensitive headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Aug 14, 2013
1 parent 30233c2 commit 5816d64
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -75,7 +75,7 @@ You can view more examples in the [example folder.](https://github.com/wearefrac

## Testing

To run the tests you either need a chromecast somewhere on your WiFi or you need to run the emulator.
To run the tests you either need to run the ChromeCast emulator locally. Mute your speakers because it will pop up videos and close them.

## LICENSE

Expand Down
10 changes: 8 additions & 2 deletions lib/App.js
Expand Up @@ -29,13 +29,19 @@ App.prototype.start = function(data, cb) {
} else if (typeof data === 'string') {
rOpt = {
headers: {
"content-type": "text/plain"
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": data.length
},
body: data
};
} else if (typeof data === 'object') {
rOpt = {json: data};
rOpt = {
json: data
};
}

rOpt.headers = rOpt.headers ? rOpt.headers : {};
rOpt.headers.Connection = 'close'; // in the spec
request.post(this.base, rOpt, cb);
return this;
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name":"nodecast",
"description":"Node interface to DIAL/RAMP/ChromeCast",
"version":"0.0.4",
"version":"0.0.5",
"homepage":"http://github.com/wearefractal/nodecast",
"repository":"git://github.com/wearefractal/nodecast.git",
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",
Expand Down
4 changes: 2 additions & 2 deletions test/app.js
Expand Up @@ -28,13 +28,13 @@ describe('app', function() {
});
});

it('should .start() then .stop()', function(done) {
it('should .start() with data then .stop()', function(done) {
this.timeout(10000);
var ee = nodecast.find();
ee.on('error', done);
ee.once('device', function(device){
var yt = device.app('YouTube');
yt.start(function(err) {
yt.start('v=oHg5SJYRHA0', function(err) {
should.not.exist(err);
yt.info(function(err, info){
should.not.exist(err);
Expand Down

0 comments on commit 5816d64

Please sign in to comment.