Todos los lenguajes y frameworks
Falco F#
Un fragmento en F# para Falco que responde a las peticiones a /pixel.gif con el GIF vacío, decodificado una sola vez al arrancar.
Falco F#
open System
open Falco
open Falco.Routing
open Microsoft.AspNetCore.Builder
let gif = Convert.FromBase64String "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
let pixel: HttpHandler =
Response.ofBinary "image/gif" [ "Cache-Control", "no-store" ] gif
let endpoints = [ get "/pixel.gif" pixel ]
let wapp = WebApplication.Create()
wapp.Urls.Add "http://0.0.0.0:8080"
wapp.UseRouting()
.UseFalco(endpoints)
.Run(Response.withStatusCode 404 >> Response.ofPlainText "Not Found")
Ejecutamos este fragmento y comparamos los bytes que devolvió.
Comprobar
curl -sI http://localhost:8080/pixel.gif