Ruby on Rails Monday, November 22, 2010

All I can find in this guide is the original response.headers["header"]
= "whatever", that I posted in my question. This doesn't work for most
common headers for me, including Location redirects, Set-Cookie, and
Content-Type, which I am assuming happens because rails uses these
headers again later down the line.

For example, when I do this:
response.headers["Content-type"] = "text/css"
render :text => css

the final content-type header which comes out of the application is
"Content-type: utf8; text/html"

However, when I do this

render :text => css, :content-type => "text/css", the final header is
what I want, "Content-type: utf8; text/css"

I can't do this for every header, like set-cookie, location redirects,
status codes, etc, I need to mass assign headers for this, which brings
us back to my original question. (and yes I would rewrite cookie names
to prevent against xss).

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment