-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy headers across redirects (#131)
What changed? ============= In order to emulate browser behavior better, we want to copy headers across redirects. Whenever we dispatch to the endpoint, `Phoenix.ConnTest.recycle/2` automatically gets called. But by default it only recycles "accept", "accept-language", and "authorization". This commit adds calls to `recycle/2` where we manually copying all request headers. For more, see [recycle/2 docs]: ``` Recycling receives a connection and returns a new connection, containing cookies and relevant information from the given one. This emulates behaviour performed by browsers where cookies returned in the response are available in following requests. By default, only the headers "accept", "accept-language", and "authorization" are recycled. However, a custom set of headers can be specified by passing a list of strings representing its names as the second argument of the function. Note recycle/1 is automatically invoked when dispatching to the endpoint, unless the connection has already been recycled. ``` [recycle/2 docs]: https://hexdocs.pm/phoenix/Phoenix.ConnTest.html#recycle/2
- Loading branch information
Showing
4 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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