Change order of comparsions and header check

This could speed up most common case (2xx response).