|
Revision 3847, 0.8 kB
(checked in by david, 3 years ago)
|
Mime types are separated by a comma, not semicolon, in the Accept header. Also switch all internal configuration of mime types away from strings and over to Mime::Type [DHH]
|
| Line | |
|---|
| 1 |
module ActionController |
|---|
| 2 |
class AbstractRequest |
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
def post_format |
|---|
| 9 |
case content_type.to_s |
|---|
| 10 |
when 'application/xml' |
|---|
| 11 |
:xml |
|---|
| 12 |
when 'application/x-yaml' |
|---|
| 13 |
:yaml |
|---|
| 14 |
else |
|---|
| 15 |
:url_encoded |
|---|
| 16 |
end |
|---|
| 17 |
end |
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
def formatted_post? |
|---|
| 21 |
post? && (post_format == :yaml || post_format == :xml) |
|---|
| 22 |
end |
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
def xml_post? |
|---|
| 26 |
post? && post_format == :xml |
|---|
| 27 |
end |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
def yaml_post? |
|---|
| 31 |
post? && post_format == :yaml |
|---|
| 32 |
end |
|---|
| 33 |
end |
|---|
| 34 |
end |
|---|