Repository navigation
Redirect statuses 302, 303, 307 and 308, and redirectReply [#741] - #743
Open
ambroise-leclerc wants to merge 1 commit into
Open
ambroise-leclerc wants to merge 1 commit into
ambroise-leclerc wants to merge 1 commit into
Conversation
Response::StatusCode gains found, seeOther, temporaryRedirect and permanentRedirect, written with their reason phrase. http::redirectReply(status, location) builds a route reply with Location, an empty body and, for the temporary ones, Cache-Control: no-store; it refuses a status that is not a redirection and a location that is empty or holds a control character.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #741.
Changes
http::Response::StatusCodegainsfound(302),seeOther(303),temporaryRedirect(307) andpermanentRedirect(308), written with their reason phrase (HTTP/1.1 303 See Other).http::redirectReply(status, location), next totextReply: a route reply withLocation, an empty body (Content-Length: 0) and, for the temporary statuses (302, 303, 307),Cache-Control: no-store. It throwsstd::invalid_argumentfor a status that is not a redirection, and for a location that is empty or holds a control character (which would split the header).docs/HTTP_ASSETS.mddocuments the helper; changelog entry underUnreleased.Tests
A route redirects with the status line, Location and caching of its status (#741): a route answering303reaches the client with its status line,Location,Cache-Control: no-storeand an empty body; a308toHEADis not markedno-store.Each redirection status has its reason phrase and its caching (#741): the status line of 301, 302, 303, 307 and 308, the headers ofredirectReplyfor each, and the refusals.