Rewrite to enable app-wide CORS support