MaxGfeller/youtube-search — pull request #4 by ericsaboia (2014-05-21 22:15:48+00:00)
Title: remove corsproxy

Hey,

I tried to use your library, but it is returning a fatal error, maybe cause the query is not properly sanitized.

Here is an example to reproduce it: https://gist.github.com/ericsaboia/24b12a4e8d18592c3159#file-youtube_search_example-js

The stack trace:

```
Error: Unquoted attribute value
Line: 1
Column: 12
Char: e
at error (/youtube-search/node_modules/xml2js/node_modules/sax/lib/sax.js:642:8)
at strictFail (/youtube-search/node_modules/xml2js/node_modules/sax/lib/sax.js:662:22)
at Object.write (/youtube-search/node_modules/xml2js/node_modules/sax/lib/sax.js:1240:11)
at Parser.exports.Parser.Parser.parseString (/youtube-search/node_modules/xml2js/lib/xml2js.js:273:29)
at Parser.parseString (/youtube-search/node_modules/xml2js/lib/xml2js.js:6:61)
at exports.parseString (/youtube-search/node_modules/xml2js/lib/xml2js.js:296:19)
at IncomingMessage. (/youtube-search/index.js:36:7)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickDomainCallback (node.js:459:13)
```

And the http response:

```

Error 400 (Bad Request)!!1

400. That’s an error.

Your client has issued a malformed or illegal request. That’s all we know.
```

So I removed the **corsproxy** (not just because of the bug, but there is no need to use it anyway) and fired the request directly to youtube api. Now everything is working fine.