switch to gocamo

This commit is contained in:
Luna D 2021-09-16 17:00:46 +02:00
parent b2fe90ba88
commit fae0827c81
No known key found for this signature in database
GPG key ID: 81AF416F2CC36FC8

View file

@ -13,12 +13,11 @@ defmodule Camo.Image do
URI.to_string(%{uri | scheme: "https", port: 443})
true ->
camo_digest = :crypto.mac(:hmac, :sha, camo_key(), input) |> Base.encode16(case: :lower)
camo_digest = :crypto.mac(:hmac, :sha, camo_key(), input) |> Base.url_encode64(padding: false)
camo_uri = %URI{
host: camo_host(),
path: "/" <> camo_digest,
query: URI.encode_query(url: input),
path: "/" <> camo_digest <> "/" <> Base.url_encode64(input, padding: false),
scheme: "https"
}