https://github.com/layoric/gatewaytest
https://github.com/layoric/gatewaytest
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/layoric/gatewaytest
- Owner: Layoric
- Created: 2024-06-03T00:35:02.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-03T00:35:33.000Z (about 2 years ago)
- Last Synced: 2025-08-15T05:02:27.391Z (11 months ago)
- Language: C#
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# web
.NET 8.0 Empty Web Template
I have slightly altered the template to demonstrate what I think is a problem with GatewayRequestFilters.
The Hello class now has an integer Mode property.
------------------------------------------------------------------------------------------------------------
https://localhost:5002/api/Hello?Name=matt&Mode=0
Setting the mode to 0 (or not setting it) causes the Hello service to return the HelloResponse, with the same Name that was passed in (this mirrors the original functionality). It should work fine.
------------------------------------------------------------------------------------------------------------
https://localhost:5002/api/Hello?Name=matt&Mode=1
Setting the mode to 1 causes the HelloService to call a second service via the Gateway, which appends ", with a Gateway detour" to the passed in name. This also should work.
------------------------------------------------------------------------------------------------------------
https://localhost:5002/api/Hello?Name=matt&Mode=2
Setting the mode to 2 causes the GatewayRequestFiltersAsync to kick in, which attempts to create a response object that reads $"Hello, {hello.Name}, short-circuited in the Request Filter". This response object is then written to the pipeline.
This mode is not working. The return from Gateway.Send is null. I attempted to load symbols and debug. I can see the response.Dto being set, and I also saw the response.OutputStream getting populated, but somewhere along the line the OutputSteam gets disposed or cleared out.