-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Description
If a URL is passed to Waffle (e.g. through cast_attachments), and the URL has no path (e.g. https://google.com), Waffle causes an exception, because it passes the path of the parsed URI to Path.basename/1 without checking for nil or / first.
Line 18 in 6a38e9a
| filename = uri.path |> Path.basename() |> URI.decode() |
** (FunctionClauseError) no function clause matching in IO.chardata_to_string/1
(elixir 1.14.2) IO.chardata_to_string(nil)
(elixir 1.14.2) lib/path.ex:383: Path.basename/1
(waffle 1.1.6) lib/waffle/file.ex:18: Waffle.File.new/2
(waffle 1.1.6) lib/waffle/actions/store.ex:54: Waffle.Actions.Store.store/2
(waffle_ecto 0.0.11) lib/waffle_ecto/type.ex:21: Waffle.Ecto.Type.cast/2
Waffle should handle this case gracefully.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels