Multipart condition bugfix; add env to request for middleware and such