Fix JSON.parse error for client HEAD requests