Add canonical middleware