Kemal Crystal
Kemal için, /pixel.gif isteklerine başlangıçta bir kez çözülen boş GIF ile yanıt veren bir Crystal örneği.
Kemal Crystal
require "base64"
require "kemal"
GIF = Base64.decode("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")
get "/pixel.gif" do |env|
env.response.content_type = "image/gif"
env.response.headers["Cache-Control"] = "no-store"
env.response.write(GIF) # write the bytes; a non-String return value is ignored
nil
end
Kemal.run(8080)
Framework'ün güncel belgelerine göre kontrol edildi.
Kontrol et
curl -sI http://localhost:8080/pixel.gif