Setting response headers before calling WriteHeader.