ajvondrak / remote_ip

A plug to rewrite the Plug.Conn's remote_ip based on forwarding headers.
MIT License
252 stars 31 forks source link

Remove dialyzer error for allowed headers (#20) #25

Closed devstopfix closed 3 years ago

devstopfix commented 3 years ago

Removes this warning as MapSet.t() is an opaque type:

lib/remote_ip/headers.ex:37:no_return The created anonymous function has no local return.


lib/remote_ip/headers.ex:37:call_without_opaque Function call without opaqueness type mismatch.

Call does not have expected opaque term of type MapSet.t(_) in the 2nd position.

RemoteIp.Headers.allow?(_ :: any(), allowed :: %MapSet{ => _})


lib/remote_ip/headers.ex:42:no_return Function allow?/2 has no local return.


lib/remote_ip/headers.ex:43:call_without_opaque Function call without opaqueness type mismatch.

Call does not have expected opaque term of type MapSet.t(_) in the 1st position.

MapSet.member?(allowed :: %MapSet{ => _}, _header :: any())

ajvondrak commented 3 years ago

Thanks for tracking this down! 🙇

devstopfix commented 3 years ago

Thank you! And thanks for the library :-). We will go live with it shortly