[10.x] Add Precognition-Success header #47081
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces an additional header to indicate that Precognition was successful.
Currently, we always return the
Precognition: true
header for any request that is precogntive.We also currently return a
204 No Content
response when Precognition is considered "Successful".We use these two indicators to currently detect when a precogntive request is successful.
However, it is possible for a precognitive request to receive a
204 No Content
response, via say a user-land middleware, that does not indicate that Precognition was actually successful, i.e., reached the "end of the line" before the controller method.With the addition of this header, we have a guaranteed way to detect "successful" precognition requests.
This is not a breaking change and the other precognition header is still useful.