Fixed determineClient to work with req.headers instead of process.env