Skip to content

Commit

Permalink
fix host regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar Olivera committed Jul 29, 2019
1 parent 1c093db commit 617bad8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion lib/whatsapp_api_request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defmodule WhatsappApiRequest do
end

def rate_limit_request(url, method, data, headers) do
[_, host, _] = Regex.run(~r/(.+:\/\/)?([^\/]+)(\/.*)*/, url)
[_, _, host, _] = Regex.run(~r/(.+:\/\/)?([^\/]+)(\/.*)*/, url)
case ExRated.check_rate(host, @scale, @limit) do
{:ok, _} ->
apply(__MODULE__, method, [data, url, headers])
Expand Down
2 changes: 0 additions & 2 deletions test/api/messages_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ defmodule Whatsapp.Api.MessagesTest do
message =
MessageOutboundHsm.new(
to: "15162837151",
type: "text",
body: "hola!"
)

assert Messages.send_hsm(token_info, message) == %{}
Expand Down

0 comments on commit 617bad8

Please sign in to comment.