Variables named "r" and "req" in the same function, both being different representations of the same request, is a bad idea. If they were named sensibly and/or the function was named "assign_headers_on_request_record", this may have been caught in a code review.