You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in database.ex for {key, val} <- doc, into: %{}, do: {String.to_atom(key), val}
https://elixir-lang.slack.com/team/hamiltop explained that this was not a very good idea in elixir and could lead to a malicious attacker crashing ones servers.
instead to_existing_atom should be used
The text was updated successfully, but these errors were encountered:
@note89 I agree but in this case wouldn't it be possible that those keys were never defined beforehand, making it crash because they're not existing yet? (example being that the DB data doesn't match the schema exactly) Or perhaps they would from the schema definition?
I think the bigger issue is that it's needed in the first place to go from String -> Symbol -> String for the response.
in database.ex
for {key, val} <- doc, into: %{}, do: {String.to_atom(key), val}
https://elixir-lang.slack.com/team/hamiltop explained that this was not a very good idea in elixir and could lead to a malicious attacker crashing ones servers.
instead
to_existing_atom
should be usedThe text was updated successfully, but these errors were encountered: