Update index.js

Code should not assume every server always returns content-type.