File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1+ # Migrating from 0.3 to 1.0
2+
3+ ### Replace ` SafeURL.get/4 ` with ` SafeURL.HTTPoison.get/3 `
4+
5+ ` SafeURL.get/4 ` has been replaced with ` SafeURL.HTTPoison.get/3 ` . It is now a
6+ drop-in replacement for ` HTTPoison.get/3 ` and thus does not support passing
7+ ` SafeURL ` options through function arguments.
8+
9+ ### Account for new error messages or use ` :detailed_error ` option
10+
11+ ` SafeURL.validate/2 ` now returns a more specific error by default:
12+
13+ ``` elixir
14+ iex> SafeURL .validate (" http://localhost" )
15+ {:error , :unsafe_reserved }
16+ iex> SafeURL .validate (" http://google.com" , schemes: [:https ])
17+ {:error , :unsafe_scheme }
18+ ```
19+
20+ You can use the ` :detailed_error ` configuration option to restore the previous
21+ behavior and get the generic ` {:error, :restricted} ` error:
22+
23+ ``` elixir
24+ iex> SafeURL .validate (" http://localhost" , detailed_error: false )
25+ {:error , :restricted }
26+ iex> Application .put_env (:safeurl , :detailed_error , false )
27+ :ok
28+ iex> SafeURL .validate (" http://localhost" )
29+ {:error , :restricted }
30+ ```
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ defmodule SafeURL.MixProject do
2424 source_url: @ github ,
2525 homepage_url: @ github ,
2626 canonical: "https://hexdocs.pm/#{ @ app } " ,
27- extras: [ "README.md" ]
27+ extras: [ "README.md" , "guides/migrating_to_1.0.md" ]
2828 ]
2929 ]
3030 end
You can’t perform that action at this time.
0 commit comments