Update index.js

Code should not assume every server always returns content-type.
Merge pull request #6 from WooDzu/patch-1

[BUG] Crash when server does not return Content-Type header