Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Simple Question #144

Open
leon1995 opened this issue Sep 15, 2018 · 1 comment
Open

Simple Question #144

leon1995 opened this issue Sep 15, 2018 · 1 comment

Comments

@leon1995
Copy link

Hey.
This might seem like a dumb question but I deployed the camo app to heroku but I dont know how to generate an camo.githubusercontent.com/... url for my pictures. What do I have to do?

Thanks!

@MadLittleMods
Copy link

See

camo/test/proxy_test.rb

Lines 240 to 245 in e59df56

def request_uri(image_url)
hexdigest = OpenSSL::HMAC.hexdigest(
OpenSSL::Digest.new('sha1'), config['key'], image_url)
encoded_image_url = hexenc(image_url)
"#{config['host']}/#{hexdigest}/#{encoded_image_url}"
end

  • Create a SHA1 hash digest from the URL
  • Hex encode the URL
  • Append everything together

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants