plumber R
/pixel.gif へのリクエストに空の GIF を返す、plumber 用の R スニペット。GIF は起動時に一度だけデコードします。
plumber R
# plumber.R
gif <- jsonlite::base64_dec("R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==")
#* @get /pixel.gif
#* @serializer contentType list(type = "image/gif")
function(res) {
res$setHeader("Cache-Control", "no-store")
gif
}
このスニペットは実行し、返されたバイト列を照合しました。
確認
curl -sI http://localhost:8080/pixel.gif