bug fix

Updated to follow the spec (http://www.w3.org/TR/XMLHttpRequest/)
update header
Merge pull request #505 from seobyeongky/patch-2

bug fix