Use request.env instead of env.

Changed env into request.env, follow the code surroundings.