Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Check response headers on write to preserve middleware order consistency #92

Closed
JunTaoLuo opened this issue Jan 19, 2017 · 1 comment
Closed
Assignees

Comments

@JunTaoLuo
Copy link
Contributor

Ran into this issue in aspnet/BasicMiddleware#199. Currently checking the response headers is triggered either by the OnStarting callback which is called when the first write to the body occurs, or when the next middleware returns. This however will not work if the previous middleware buffers the response so no write occurs but modifies the headers on write.

The proposal is to check the response headers relevant to response caching on write as well as the current triggers. This will guarantee that the behaviour will match the middleware order.

@Tratcher
Copy link
Member

If you check on write and on unwind then you should not need OnStarting anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants