I would like to prepend all JSON responses with following string:
)]}',\n
What is the best way to achieve this with ASP.NET Core? I would like to have it enabled for all JSON responses automatically.
I would like to prepend all JSON responses with following string:
)]}',\n
What is the best way to achieve this with ASP.NET Core? I would like to have it enabled for all JSON responses automatically.
You could use a Middleware that checks the following condition (or whatever condition you need).
if(context.Response.ContentType == "application/json")
Then you just append prepend the context.Response.Body with your string.