41484f62cc
* Throw error if res is accessed after gSSP returns Currently it's possible to access the `ServerResponse` through `context.res` in `getServerSideProps()`. If one was to store that response and mutate its headers or status code after gSSP returns (e.g. during rendering), it would currently happen to work because of when headers are sent. However, this is an anti-pattern that relies an implementation detail of the framework and shouldn't be allowed. This will be particularly important once Next.js starts to support basic streaming (two-part flush: routing then data) because then the headers will be sent as soon as gSSP returns, which explicitly breaks this pattern. With this commit, the framework now throws an error in development mode if the ServerResponse is accessed after gSSP returns. * fixup! Throw error if res is accessed after gSSP returns |
||
---|---|---|
.. | ||
pages | ||
test | ||
next.config.js | ||
world.txt |