Repository: phoenixframework/phoenix
Pull request #4478 (2021-09-10 21:23:21)

Check for a redirect to "/" more strictly


Patch:
diff --git a/guides/deployment/gigalixir.md b/guides/deployment/gigalixir.md
index e903b2d74..f75fefcad 100644
--- a/guides/deployment/gigalixir.md
+++ b/guides/deployment/gigalixir.md
@@ -93,16 +93,20 @@ $ echo 'erlang_version=22.3' >> elixir_buildpack.config
 $ echo 'node_version=12.16.3' > phoenix_static_buildpack.config
 ```
 
-If you are using Phoenix v1.6, there is also a `mix assets.deploy` alias in your `mix.exs` that you want to invoke post compilation:
+Phoenix v1.6 uses `esbuild` to compile your assets but all Gigalixir images come with `npm`, so we will configure `npm` directly to deploy our assets. Add a `assets/package.json` file if you don't have any with the following:
 
-```console
-$ echo 'hook_post_compile="mix assets.deploy && rm -f _build/esbuild"' >> elixir_buildpack.config
+```json
+{
+  "scripts": {
+    "deploy": "cd .. && mix assets.deploy && rm -f _build/esbuild"
+  }
+}
 ```
 
 Finally don't forget to commit:
 
 ```console
-$ git add elixir_buildpack.config phoenix_static_buildpack.config
+$ git add elixir_buildpack.config phoenix_static_buildpack.config assets/package.json
 $ git commit -m "Set Elixir, Erlang, and Node version"
 ```
 
diff --git a/lib/phoenix/endpoint.ex b/lib/phoenix/endpoint.ex
index b27287e68..2bf0806d7 100644
--- a/lib/phoenix/endpoint.ex
+++ b/lib/phoenix/endpoint.ex
@@ -114,7 +114,7 @@ defmodule Phoenix.Endpoint do
       set this value explicitly. This is used by projects such as `LiveView` to
       detect if the client is running on the latest version of all assets.
 
-    * `:cache_manifest_skip_vsn` - when true, skips the appended query string 
+    * `:cache_manifest_skip_vsn` - when true, skips the appended query string
       "?vsn=d" when generatic paths to static assets. This query string is used
       by `Plug.Static` to set long expiry dates, therefore, you should set this
       option to true only if you are not using `Plug.Static` to serve assets,
@@ -885,10 +885,10 @@ defmodule Phoenix.Endpoint do
   The following configuration applies only to `:longpoll`:
 
     * `:window_ms` - how long the client can wait for new messages
-      in its poll request
+      in its poll request, defaults to 10_000ms.
 
     * `:pubsub_timeout_ms` - how long a request can wait for the
-      pubsub layer to respond
+      pubsub layer to respond, defaults to 2000ms.
 
     * `:crypto` - options for verifying and signing the token, accepted
       by `Phoenix.Token`. By default tokens are valid for 2 weeks


Test patch:
diff --git a/priv/templates/phx.gen.auth/registration_controller_test.exs b/priv/templates/phx.gen.auth/registration_controller_test.exs
index 02ac94dd4..085b21570 100644
--- a/priv/templates/phx.gen.auth/registration_controller_test.exs
+++ b/priv/templates/phx.gen.auth/registration_controller_test.exs
@@ -29,7 +29,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
         })
 
       assert get_session(conn, :<%= schema.singular %>_token)
-      assert redirected_to(conn) =~ "/"
+      assert redirected_to(conn) == "/"
 
       # Now do a logged in request and assert on the menu
       conn = get(conn, "/")
diff --git a/priv/templates/phx.gen.auth/session_controller_test.exs b/priv/templates/phx.gen.auth/session_controller_test.exs
index 5f189f6a4..c5a883b2c 100644
--- a/priv/templates/phx.gen.auth/session_controller_test.exs
+++ b/priv/templates/phx.gen.auth/session_controller_test.exs
@@ -30,7 +30,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
         })
 
       assert get_session(conn, :<%= schema.singular %>_token)
-      assert redirected_to(conn) =~ "/"
+      assert redirected_to(conn) == "/"
 
       # Now do a logged in request and assert on the menu
       conn = get(conn, "/")
@@ -51,7 +51,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
         })
 
       assert conn.resp_cookies["_<%= web_app_name %>_<%= schema.singular %>_remember_me"]
-      assert redirected_to(conn) =~ "/"
+      assert redirected_to(conn) == "/"
     end
 
     test "logs the <%= schema.singular %> in with return to", %{conn: conn, <%= schema.singular %>: <%= schema.singular %>} do