Update worker.js

update deprecated middlewares