Allow optional cross-origin resource sharing of served assets in middleware