do not read response body of redirect
fix str_replace
handle i/o error during reading