Fix "Refused to set unsafe header 'Content-Length'" error