| 5 | | # Pick a unique cookie name to distinguish our session data from others' |
|---|
| 6 | | session :session_key => '_alternc_session_id' |
|---|
| | 5 | session :session_key => 'alternc_session_id' |
|---|
| | 6 | before_filter :set_header |
|---|
| | 7 | |
|---|
| | 8 | def set_header |
|---|
| | 9 | if session[:test_xhtml].nil? |
|---|
| | 10 | if @request.env['HTTP_ACCEPT'].include?("application/xhtml+xml") |
|---|
| | 11 | session[:test_xhtml] = true |
|---|
| | 12 | else |
|---|
| | 13 | session[:test_xhtml] = false |
|---|
| | 14 | end |
|---|
| | 15 | end |
|---|
| | 16 | if session[:test_xhtml] |
|---|
| | 17 | headers["Content-Type"] = "application/xhtml+xml; charset=utf-8" |
|---|
| | 18 | else |
|---|
| | 19 | headers["Content-Type"] = "text/html; charset=utf-8" |
|---|
| | 20 | end |
|---|
| | 21 | end |
|---|