summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-02-13 17:27:29 +0100
committermguetlein <martin.guetlein@gmail.com>2011-02-13 17:27:29 +0100
commit6a720662721f3c7b67d41189cb8966929b30a048 (patch)
treed11334cfbfcdfcce38f7585a4a9d7cf72d3f9ef6
parentadaea8a18537d6a436d2d41427c7ef2fda1156cc (diff)
set text/html to default value of report to make validation with validator possible
-rw-r--r--report/report_format.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/report/report_format.rb b/report/report_format.rb
index 98dea39..67abc1e 100644
--- a/report/report_format.rb
+++ b/report/report_format.rb
@@ -12,23 +12,15 @@ module Reports::ReportFormat
# returns report-format, according to header value
def self.get_format(accept_header_value)
-
case accept_header_value
- when /text\/html/
- "text/html"
when /application\/rdf\+xml/
"application/rdf+xml"
when /text\/xml/
"text/xml"
- when /application\/x-yaml|\*\/\*/
+ when /application\/x-yaml/
"application/x-yaml"
else
- raise OpenTox::BadRequestError.new("Accept header '"+accept_header_value.to_s+
- "' not supported, supported types are "+
- "text/html"+", "+
- "application/rdf+xml"+", "+
- "text/xml"+", "+
- "application/x-yaml")
+ "text/html"
end
end