make middleware em-http compatible