add middleware v2.6 source code