How do I set Response Headers?


#1

Want to set custom response headers with Jets. How do I do that?


#2

Here’s an example of setting response headers.

  def index
    response.headers["Set-Cookie"] = "foo=bar"
    response.set_header("Custom", "MyHeader") # also works
    set_header("Custom", "MyHeader") # also works
  end

Issue with CORS for specific domain