Looking for sample that modifies a response #270
-
Some detailsI have built the sample apps, and I thought the reverse proxy sample would provide an example of modifying a response. Can you please point out how I would modify a response while acting as a proxy, and if there is a sample that does this? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
What aspect of the response? Preview2 added support for modifying response headers: Modifying the response body is not a feature we plan first class support for in the proxy, it's very content dependent. However, it is possible to do this via your own middleware. Here's one example: |
Beta Was this translation helpful? Give feedback.
What aspect of the response?
Preview2 added support for modifying response headers:
https://microsoft.github.io/reverse-proxy/articles/transforms.html#response-headers-and-trailers
Modifying the response body is not a feature we plan first class support for in the proxy, it's very content dependent. However, it is possible to do this via your own middleware. Here's one example:
https://github.com/dotnet/aspnetcore/blob/04ecd5539f7476ea91c504fea7aa765d7df66e6b/src/Middleware/ResponseCompression/src/ResponseCompressionMiddleware.cs