To prevent harmful requests from Adobe Flash or PDF documents
defmodule Vulnerable do
use Plug.Router
plug :match
plug :dispatch
get "" do
conn
|> send_resp(200, "OK")
end
match _ do
send_resp(conn, 404, "Not found")
end
end
In this Elixir code snippet, the application is lacking the X-Permitted-Cross-Domain-Policies header.
defmodule Secure do
use Plug.Router
plug :match
plug :dispatch
get "" do
conn
|> put_resp_header("x-permitted-cross-domain-policies", "none")
|> send_resp(200, "OK")
end
match _ do
send_resp(conn, 404, "Not found")
end
end
In this Elixir code snippet, the application is setting the X-Permitted-Cross-Domain-Policies header to 'none'.