File tree Expand file tree Collapse file tree
copi.owasp.org/lib/copi_web/controllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,11 +25,14 @@ defmodule CopiWeb.ApiController do
2525 { :ok , dealt_card } ->
2626 with { :ok , updated_game } <- Game . find ( game . id ) do
2727 CopiWeb.Endpoint . broadcast ( topic ( game . id ) , "game:updated" , updated_game )
28+ conn |> json ( % { "id" => dealt_card . id } )
2829 else
2930 { :error , _reason } ->
30- conn |> put_status ( :internal_server_error ) |> json ( % { "error" => "Could not find updated game" } )
31+ # V16.5.3: Fail securely if the updated game cannot be loaded/broadcast
32+ conn
33+ |> put_status ( :internal_server_error )
34+ |> json ( % { "error" => "Could not find updated game" } )
3135 end
32- conn |> json ( % { "id" => dealt_card . id } )
3336 { :error , _changeset } ->
3437 conn |> put_status ( :internal_server_error ) |> json ( % { "error" => "Could not update dealt card" } )
3538 end
You can’t perform that action at this time.
0 commit comments