Skip to content

Commit

Permalink
Merge branch 'master' of github.com:CargoSense/ex_aws
Browse files Browse the repository at this point in the history
  • Loading branch information
benwilson512 committed Nov 10, 2015
2 parents 6709fcc + 789f29e commit e667050
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/ex_aws/sqs/request.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ defmodule ExAws.SQS.Request do
ExAws.Request.request(:post, url(client.config, queue_name), query, headers, client)
end

def url(%{scheme: scheme, host: host}, queue_name) do
def url(%{scheme: scheme, host: host, port: port}, queue_name) do
[
scheme,
host,
port |> port(),
queue_name |> with_slash
] |> IO.iodata_to_binary
end

defp port(80), do: ""
defp port(p), do: ":#{p}"

def with_slash(""), do: "/"
def with_slash(queue), do: ["/", queue]

Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ defmodule ExAws.Mixfile do
sqs: [
scheme: "https://",
host: {"$region", "sqs.$region.amazonaws.com"},
region: "us-east-1"
region: "us-east-1",
port: 80
]
]
end
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"hackney": {:hex, :hackney, "1.2.0"},
"httpoison": {:hex, :httpoison, "0.7.0"},
"httpotion": {:hex, :httpotion, "2.0.0"},
"ibrowse": {:git, "git://github.com/cmullaparthi/ibrowse.git", "ea3305d21f37eced4fac290f64b068e56df7de80", [tag: "v4.1.2"]},
"ibrowse": {:git, "https://github.com/cmullaparthi/ibrowse.git", "ea3305d21f37eced4fac290f64b068e56df7de80", [tag: "v4.1.2"]},
"idna": {:hex, :idna, "1.0.2"},
"jsx": {:hex, :jsx, "2.5.3"},
"mixunit": {:hex, :mixunit, "0.9.2"},
Expand Down

0 comments on commit e667050

Please sign in to comment.