elixir-maru / maru

Elixir RESTful Framework
https://maru.readme.io
BSD 3-Clause "New" or "Revised" License
1.32k stars 84 forks source link

Allow URI to be used for 'redirect'. #104

Closed jalcine closed 6 years ago

jalcine commented 6 years ago

I tend to do a lot of URI validation when I'm handling redirects. This change allows you to pass in a URI to use for redirecting. It's a bit more semantically correct (and helps with a bit of type-checking).

falood commented 6 years ago

Thanks @jalcine but there's a compile warning about it, could you also fix it?

Compiling 56 files (.ex)
warning: definitions with multiple clauses and default values require a header. Instead of:
    def foo(:first_clause, b \\ :default) do ... end
    def foo(:second_clause, b) do ... end
one should write:
    def foo(a, b \\ :default)
    def foo(:first_clause, b) do ... end
    def foo(:second_clause, b) do ... end
def redirect/3 has multiple clauses and defines defaults in one or more clauses
  lib/maru/response.ex:27
jalcine commented 6 years ago

Hmm. I'm using 1.6, didn't get this. Lemme check it out.

falood commented 6 years ago

it's a compile warning, run mix clean and you'll see it when recompile 🙂

jalcine commented 6 years ago

Pushed up that fix.

falood commented 6 years ago

thanks @jalcine